Module: BcmsBlog::BlogHelper

Defined in:
app/helpers/bcms_blog/blog_helper.rb

Instance Method Summary collapse

Instance Method Details

#_blog_path(blog, route_name, route_params) ⇒ Object

We can’t call it ‘blog_path’ because that would conflict with the actual named route method if there’s a blog named “Blog”.



4
5
6
# File 'app/helpers/bcms_blog/blog_helper.rb', line 4

def _blog_path(blog, route_name, route_params)
  send("#{blog.name_for_path}_#{route_name}_path", route_params)
end

#_blog_post_path(blog_post) ⇒ Object



8
9
10
# File 'app/helpers/bcms_blog/blog_helper.rb', line 8

def _blog_post_path(blog_post)
  send("#{blog_post.route_name}_path", blog_post.route_params)
end


12
13
14
15
# File 'app/helpers/bcms_blog/blog_helper.rb', line 12

def feeds_link_tag_for(name)
  blog = Blog.find_by_name(name)
  auto_discovery_link_tag(:rss, main_app.blog_feeds_url(:blog_id => blog), :title => "#{blog.name}")
end

#new_comment_params(portlet) ⇒ Object



17
18
19
20
# File 'app/helpers/bcms_blog/blog_helper.rb', line 17

def new_comment_params(portlet)
  {:url=> Cms::Engine.routes.url_helpers.portlet_handler_path(:id=>portlet.id, :handler=>'create_comment'), 
  :method=>'post'}
end