simplest_view 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -25,6 +25,7 @@ Or install it yourself as:
25
25
  1. Inside of your `ApplicationController` or a specific controller: `include SimplestView`
26
26
  2. `mv app/views app/templates`
27
27
  3. mkdir app/views
28
+ 4. append `app/views` to the Rails `autoload_paths` inside of `application.rb`
28
29
 
29
30
  Inside of app/views, created directories for each of your controllers. Within each controller directory, create a view to match the actions in your controller.
30
31
 
data/lib/simplest_view.rb CHANGED
@@ -6,10 +6,12 @@ module SimplestView
6
6
  end
7
7
 
8
8
  def view_context_class_name
9
- controller = self.class.name.sub(/Controller$/, "").underscore
10
- action = action_name + "_view"
9
+ @_view_context_class_name ||= begin
10
+ controller = self.class.name.sub(/Controller$/, "").underscore
11
+ action = action_name + "_view"
11
12
 
12
- File.join(controller, action).camelize
13
+ File.join(controller, action).camelize
14
+ end
13
15
  end
14
16
 
15
17
  # Rails 3/4
@@ -31,7 +33,7 @@ module SimplestView
31
33
  end
32
34
  end
33
35
  rescue NameError => e
34
- Rails.logger.warn "No View defined for #{klass_name}"
36
+ Rails.logger.warn "No View defined for #{view_context_class_name}"
35
37
  super
36
38
  end
37
39
  end
@@ -1,3 +1,3 @@
1
1
  module SimplestView
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplest_view
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: