开发者

How to add current_item class to devise navigation?

开发者 https://www.devze.com 2023-04-03 09:27 出处:网络
i want to add a current_item class to an active devise navigation, like login, registration etc. the menu consists also of some static pages, which are generated by the high_voltage gem. here i set it

i want to add a current_item class to an active devise navigation, like login, registration etc. the menu consists also of some static pages, which are generated by the high_voltage gem. here i set it by the active page id and a class in the body tag.

how can i realize this for the 开发者_开发技巧devise navigation? any advice?

thanks


fixed it myself with a helper in application_helper.rb

def set_title
  if controller_name == "registrations" && action_name == "new"
    "mitmachen"
  elsif controller_name == "sessions" && action_name == "new"
    "login"
  else
    params[:id]
  end
end
0

精彩评论

暂无评论...
验证码 换一张
取 消