Skip to content

Commit

Permalink
fixed dryml_fallback_tag call in page_tag_resolver and added a contro…
Browse files Browse the repository at this point in the history
…ller accessor
  • Loading branch information
ddnexus committed Oct 14, 2010
1 parent c38d037 commit 358b538
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions dryml/lib/dryml/extensions/action_controller/dryml_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
append_view_path Dryml::Railtie::PageTagResolver.new(self)
end

attr_accessor :dryml_fallback_tag

# dryml does not use layouts
def action_has_layout?
false
Expand All @@ -13,10 +15,6 @@ def dryml_context
@this
end

def dryml_fallback_tag(tag_name)
@dryml_fallback_tag = tag_name
end

def call_dryml_tag(tag, options={})
# TODO: Figure out what this bit is all about :-)
if options[:with]
Expand Down
2 changes: 1 addition & 1 deletion dryml/lib/dryml/railtie/page_tag_resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def initialize(controller)
end

def find_templates(name, prefix, partial, details)
tag_name = @dryml_fallback_tag || name.dasherize + '-page'
tag_name = @controller.dryml_fallback_tag || name.dasherize + '-page'
text = @controller.call_dryml_tag(tag_name)
return [] unless text
[ActionView::Template.new(text, "dryml-tag:#{tag_name}", Dryml::Railtie::PageTagHandler, details)]
Expand Down

0 comments on commit 358b538

Please sign in to comment.