I am trying to have the Devise log in form be on my home page.
When I just copy the form over, of course I get errors because the 'resource' variables and etc are not set in the action.
I found this solution on the internet: http://pupeno.com/blog/show-a-devise-log-in-form-in-another-page/
However, his solution is to set the needed variables in a module called ContentHelper.
Where do I put this code? I tried putting it in the initializers, but I still get the error about 'resource' variable not existing
See if this entry in the devise wiki helps you!
Put the module in a file in app/helpers/content_helper.rb
. If you still get errors add helper :content
to your controller.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.