ruby on rails - Rendering Devise Gem signup form in My Form -


hi guys past few days working on "ror" . copied devise gem sign form registrations/new > , added following helper

helper/accounts_helper.rb

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

views/accounts/new

<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) |f| %>   <%= devise_error_messages! %>   email</label></small><%= f.email_field :email, :autofocus => true , label: false %>   </div>     password</label></small><%= f.password_field :password, label: false %>    </div>  </div>   confirm password</label></small><%= f.password_field :password_confirmation , label: false %>   f.submit "sign up" ,  class: "btn btn-default pull-left"%>  <= render "devise/shared/links" %>          <end > 

admin these form , these should saved devise users tables? should in controller/model??

fyi can change devise paths, can have registrations happening in accounts rather registrations:

#config/routes.rb devise_for :users, path: "accounts", path_names: { sign_in: 'login', password: 'forgot', confirmation: 'confirm', unlock: 'unblock', sign_up: new', sign_out: 'logout'} 

this create /accounts/new register, , accounts/login login


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -