ruby on rails 3 - Devise: how can I access the helper methods in all my controllers -


i'm trying implement devise sign in form in nav bar header(twitter bootstrap), tells me resource isn't defined method.

do need somehow inherit devise helper methods achieve this?

when comes creating custom sign in page, doesn't have controller, has accessing things in view, through helper of helper methods. want add them application_helper.rb file. there overview of method here:

https://github.com/plataformatec/devise/wiki/how-to:-display-a-custom-sign_in-form-anywhere-in-your-app

in nutshell, want add yours application_helper.rb

def resource_name  :user end  def resource   @resource ||= user.new end  def devise_mapping   @devise_mapping ||= devise.mappings[:user] end 

i have used bunch of times in projects make custom sign in forms in navbar when use twitter bootstrap. works great , doesn't require change other code anywhere else.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -