CultivateLabs / storytime

Storytime is a Rails 4+ CMS and blogging engine, with a core focus on content. It is built and maintained by @cultivatelabs
MIT License
752 stars 81 forks source link

Fix #137 - Set active blog li element to active when selected #138

Closed eanlain closed 9 years ago

bcroesch commented 9 years ago

@eanlain other than the one comment, looks good. Feel free to merge after that.

rusikf commented 9 years ago

:+1: @bcroesch , In the result it can be

def active_blog_item_class(blog)
  'class="active"'.html_safe if params[:blog_id] == blog.slug && params[:controller] == "storytime/dashboard/posts"
end

or

def active_blog_item_class(blog)
  'class="active"'.html_safe if params[:blog_id] == blog.slug && controller_name == "posts"
end