ruhl 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/ruhl/rails.rb +4 -4
- data/lib/ruhl/rails/ruhl_presenter.rb +9 -4
- data/ruhl.gemspec +2 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.1.0
|
data/lib/ruhl/rails.rb
CHANGED
@@ -9,11 +9,11 @@ module Ruhl
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def render(template, options = {})
|
12
|
-
|
12
|
+
layout_template = @action_view.controller.active_layout(options[:layout])
|
13
13
|
|
14
|
-
if
|
15
|
-
options[:layout] =
|
16
|
-
options[:layout_source] =
|
14
|
+
if layout_template
|
15
|
+
options[:layout] = layout_template.filename
|
16
|
+
options[:layout_source] = layout_template.source
|
17
17
|
end
|
18
18
|
|
19
19
|
Ruhl::Engine.new(template.source, options).render(@action_view)
|
@@ -46,11 +46,16 @@ module ActionController
|
|
46
46
|
|
47
47
|
protected
|
48
48
|
|
49
|
-
def present(
|
50
|
-
|
49
|
+
def present(options = {})
|
50
|
+
action_sym = options[:action] || action_name
|
51
|
+
object_sym = options[:object] || controller_name.singularize
|
51
52
|
|
52
|
-
|
53
|
-
|
53
|
+
params = { :template => "#{controller_name}/#{action_sym}",
|
54
|
+
:locals => {:object => presenter_for(object_sym) } }
|
55
|
+
|
56
|
+
params[:layout] = options[:layout] if options.has_key?(:layout)
|
57
|
+
|
58
|
+
render params
|
54
59
|
end
|
55
60
|
|
56
61
|
def presenter_for(object)
|
data/ruhl.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{ruhl}
|
8
|
-
s.version = "1.
|
8
|
+
s.version = "1.1.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Andrew Stone"]
|
12
|
-
s.date = %q{2010-01-
|
12
|
+
s.date = %q{2010-01-30}
|
13
13
|
s.description = %q{Make your HTML dynamic with the addition of a data-ruhl attribute.}
|
14
14
|
s.email = %q{andy@stonean.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruhl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Stone
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-01-
|
12
|
+
date: 2010-01-30 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|