exhibit 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Exhibit is a simple gem to generate and work with presenters in Rails 3. It is based on the solution Ryan Bates created in [Railscasts Pro episode #287](http://railscasts.com/episodes/287-presenters-from-scratch).
|
4
4
|
|
5
|
-
version 0.1.
|
5
|
+
version 0.1.2
|
6
6
|
Robin Brouwer
|
7
7
|
45north
|
8
8
|
|
@@ -44,7 +44,14 @@ You can also use `delegate` to delegate methods to the User Model.
|
|
44
44
|
delegate :email, :to => :user
|
45
45
|
end
|
46
46
|
|
47
|
-
|
47
|
+
Want to add methods that can be used inside all of your presenters? Run the following command:
|
48
|
+
|
49
|
+
rails g exhibit:base
|
50
|
+
|
51
|
+
A new initializer will be created: config/initializers/exhibit_presenter.rb.
|
52
|
+
You can add methods to this class to extend it and use it inside all presenters.
|
53
|
+
|
54
|
+
But how can you actually use presenters inside the view? It works the same as Ryan shows you in [Railscasts Pro episode #287](http://railscasts.com/episodes/287-presenters-from-scratch):
|
48
55
|
|
49
56
|
<% exhibit(@user) do |user| %>
|
50
57
|
<p>
|
data/lib/exhibit/version.rb
CHANGED
@@ -1,9 +1,13 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
Available generators:
|
2
|
+
exhibit:presenter
|
3
|
+
exhibit:base
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
Examples:
|
6
|
+
rails g exhibit:presenter User
|
7
|
+
This will create:
|
8
|
+
app/presenters
|
9
|
+
app/presenters/user_presenter.rb
|
10
|
+
|
11
|
+
rails g exhibit:base
|
12
|
+
This will create:
|
13
|
+
config/initializers/exhibit_presenter.rb
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exhibit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Robin Brouwer
|
@@ -46,7 +46,9 @@ files:
|
|
46
46
|
- lib/exhibit/presenter.rb
|
47
47
|
- lib/exhibit/version.rb
|
48
48
|
- lib/exhibit.rb
|
49
|
+
- lib/generators/exhibit/base_generator.rb
|
49
50
|
- lib/generators/exhibit/presenter_generator.rb
|
51
|
+
- lib/generators/exhibit/templates/exhibit_presenter.rb
|
50
52
|
- lib/generators/exhibit/templates/presenter
|
51
53
|
- lib/generators/exhibit/USAGE
|
52
54
|
- lib/tasks/exhibit_tasks.rake
|