Note that there are some explanatory texts on larger screens.

plurals
  1. PORails: Resource and Forms
    text
    copied!<p><em>Preface: I'm not sure what resources are.</em></p> <p>I need this form (which is working from the <code>user/sign_up</code> route) to work on my 'offline page'--so users can still register when my app is down. My application_controller calls a <code>:filter_before, :except =&gt; [:offline]</code> and my registrations_controller has a <code>:skip_filter_before</code> action. (Is it called an action?)</p> <pre><code>&lt;%= form_for(resource, :as =&gt; resource_name, :url =&gt; registration_path(resource_name)) do |f| %&gt; &lt;%= devise_error_messages! %&gt; &lt;p&gt;&lt;%= f.label :email %&gt;&lt;br /&gt; &lt;%= f.email_field :email %&gt;&lt;/p&gt; &lt;p&gt;&lt;%= f.submit "Sign up" %&gt;&lt;/p&gt; &lt;% end %&gt; </code></pre> <p>My Registration_controller:</p> <pre><code>class RegistrationsController &lt; Devise::RegistrationsController before_filter :get_teams skip_filter :require_online def create build_resource if resource.save if resource.active_for_authentication? set_flash_message :notice, :signed_up if is_navigational_format? respond_with resource, :location =&gt; redirect_location(resource_name, resource) else set_flash_message :notice, :inactive_signed_up, :reason =&gt; resource.inactive_message.to_s if is_navigational_format? expire_session_data_after_sign_in! respond_with resource, :location =&gt; after_inactive_sign_up_path_for(resource) end else clean_up_passwords(resource) respond_with_navigational(resource) { render_with_scope :new } end end ... end </code></pre> <p>Routes:</p> <pre><code> confirm_account /confirm_account(.:format) {:controller=&gt;"confirmations", :action=&gt;"confirm_account"} sign_up /sign_up(.:format) {:action=&gt;"sign_up", :controller=&gt;"user/sign_up"} new_user_session GET /user/sign_in(.:format) {:action=&gt;"new", :controller=&gt;"devise/sessions"} user_session POST /user/sign_in(.:format) {:action=&gt;"create", :controller=&gt;"devise/sessions"} destroy_user_session GET /user/sign_out(.:format) {:action=&gt;"destroy", :controller=&gt;"devise/sessions"} user_password POST /user/password(.:format) {:action=&gt;"create", :controller=&gt;"devise/passwords"} new_user_password GET /user/password/new(.:format) {:action=&gt;"new", :controller=&gt;"devise/passwords"} edit_user_password GET /user/password/edit(.:format) {:action=&gt;"edit", :controller=&gt;"devise/passwords"} PUT /user/password(.:format) {:action=&gt;"update", :controller=&gt;"devise/passwords"} cancel_user_registration GET /user/cancel(.:format) {:action=&gt;"cancel", :controller=&gt;"registrations"} user_registration POST /user(.:format) {:action=&gt;"create", :controller=&gt;"registrations"} new_user_registration GET /user/sign_up(.:format) {:action=&gt;"new", :controller=&gt;"registrations"} edit_user_registration GET /user/edit(.:format) {:action=&gt;"edit", :controller=&gt;"registrations"} PUT /user(.:format) {:action=&gt;"update", :controller=&gt;"registrations"} DELETE /user(.:format) {:action=&gt;"destroy", :controller=&gt;"registrations"} user_confirmation POST /user/confirmation(.:format) {:action=&gt;"create", :controller=&gt;"confirmations"} new_user_confirmation GET /user/confirmation/new(.:format) {:action=&gt;"new", :controller=&gt;"confirmations"} GET /user/confirmation(.:format) {:action=&gt;"show", :controller=&gt;"confirmations"} user_unlock POST /user/unlock(.:format) {:action=&gt;"create", :controller=&gt;"devise/unlocks"} new_user_unlock GET /user/unlock/new(.:format) {:action=&gt;"new", :controller=&gt;"devise/unlocks"} GET /user/unlock(.:format) {:action=&gt;"show", :controller=&gt;"devise/unlocks"} editreject_admin GET /admin/:id/editreject(.:format) {:action=&gt;"editreject", :controller=&gt;"admin"} reject_admin GET /admin/:id/reject(.:format) {:action=&gt;"reject", :controller=&gt;"admin"} accept_admin GET /admin/:id/accept(.:format) {:action=&gt;"accept", :controller=&gt;"admin"} entries_admin_index GET /admin/entries(.:format) {:action=&gt;"entries", :controller=&gt;"admin"} preferences_admin_index GET /admin/preferences(.:format) {:action=&gt;"preferences", :controller=&gt;"admin"} admin_index GET /admin(.:format) {:action=&gt;"index", :controller=&gt;"admin"} about_entries GET /entries/about(.:format) {:action=&gt;"about", :controller=&gt;"entries"} all_entries GET /entries/all(.:format) {:action=&gt;"all", :controller=&gt;"entries"} myentries_entries GET /entries/myentries(.:format) {:action=&gt;"myentries", :controller=&gt;"entries"} rate_entry GET /entries/:id/rate(.:format) {:action=&gt;"rate", :controller=&gt;"entries"} submit_entry PUT /entries/:id/submit(.:format) {:action=&gt;"submit", :controller=&gt;"entries"} entry_comments POST /entries/:entry_id/comments(.:format) {:action=&gt;"create", :controller=&gt;"comments"} entry_comment DELETE /entries/:entry_id/comments/:id(.:format) {:action=&gt;"destroy", :controller=&gt;"comments"} entries GET /entries(.:format) {:action=&gt;"index", :controller=&gt;"entries"} POST /entries(.:format) {:action=&gt;"create", :controller=&gt;"entries"} new_entry GET /entries/new(.:format) {:action=&gt;"new", :controller=&gt;"entries"} edit_entry GET /entries/:id/edit(.:format) {:action=&gt;"edit", :controller=&gt;"entries"} entry GET /entries/:id(.:format) {:action=&gt;"show", :controller=&gt;"entries"} PUT /entries/:id(.:format) {:action=&gt;"update", :controller=&gt;"entries"} DELETE /entries/:id(.:format) {:action=&gt;"destroy", :controller=&gt;"entries"} /auth/:service/callback(.:format) {:controller=&gt;"services", :action=&gt;"create"} services GET /services(.:format) {:action=&gt;"index", :controller=&gt;"services"} POST /services(.:format) {:action=&gt;"create", :controller=&gt;"services"} root /(.:format) {:controller=&gt;"entries", :action=&gt;"index"} countdown /countdown(.:format) {:controller=&gt;"application", :action=&gt;"countdown"} </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload