Sang ho Lim
2010-Nov-03 06:01 UTC
How can I generate devise sign_in form within different controller?
I am trying to generate devise sign_in form, from the different
controller/views( which is called ''mains_controller'' in my
case)
I asked a question on stackoverflow.com but did not get the satisfiable
answer. You can read the specific question in there.
http://stackoverflow.com/questions/4081744/devise-form-within-a-different-controller
I am stuck with the ''build_resource'' from devise. The
session_controller
which takes care of sign_in/sign_out has a method call called
''build_resource.'' It seems that build_resource creates a
adequate value
for ''resource'' and ''resource_name'' for
sign_in form.
<%= form_for(resource, :as => resource_name, :url =>
session_path(resource_name)) do |f| %>
But thats the case in devise related controllers. If i put
''build_resource'' line with in my own
''mains_controller'' it throws out
error saying that there is no such method like
''build_resource.''
How can I resolve this problem?
If I create a form inline ruby code, it seems that
<% if devise_mapping.rememberable? -%>
<p><%= f.check_box :remember_me %> <%= f.label :remember_me
%></p>
<% end -%>
''devise_mapping'' part above does not work.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.