Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module ApplicationHelper
- def title(page_title)
- content_for(:title) { h(page_title.to_s) }
- end
- def yield_for(content_sym,default = "")
- output = content_for(content_sym)
- output = default if output.blank?
- output
- end
- # Block helper
- def block_to_partial(partial_name, options = {}, &block)
- options.merge!(:body => capture(&block))
- render(:partial => partial_name, :locals => options)
- end
- def block(title, options = {}, &block)
- block_to_partial('layouts/block', options.merge(:title => title), &block)
- end
- def article(title, options = {}, &block)
- block_to_partial('layouts/article', options.merge(:title => title), &block)
- end
- end
Add Comment
Please, Sign In to add comment