Changes in Registration Process

This commit is contained in:
saurabhbhatia 2013-11-25 17:03:28 +08:00
parent 242878a09f
commit dead52d8ab
7 changed files with 15 additions and 9 deletions

View File

@ -1,7 +1,6 @@
class SessionsController < Devise::SessionsController class SessionsController < Devise::SessionsController
def create def create
debugger
super super
reset_session reset_session
end end

View File

@ -1,4 +1,5 @@
class Desktop::RegistrationsController < Devise::RegistrationsController class Desktop::RegistrationsController < Devise::RegistrationsController
def update def update
self.resource = resource_class.to_adapter.get!(send(:"current_#{resource_name}").to_key) self.resource = resource_class.to_adapter.get!(send(:"current_#{resource_name}").to_key)

View File

@ -0,0 +1,3 @@
class RegistrationsController < Devise::RegistrationsController
layout "devise"
end

View File

@ -60,6 +60,10 @@ class User
validates :user_id, validates :user_id,
:presence => { :message => I18n.t("users.user_id_not_null") } , :presence => { :message => I18n.t("users.user_id_not_null") } ,
:length => {:minimum => 3, :maximum => 50, :message => I18n.t("users.user_id_length") } :length => {:minimum => 3, :maximum => 50, :message => I18n.t("users.user_id_length") }
def email_required?
false
end
# validates_uniqueness_of :email,:message=> I18n.t("devise.registrations.email_not_unique") # validates_uniqueness_of :email,:message=> I18n.t("devise.registrations.email_not_unique")
# def new_attribute_values=(vars) # def new_attribute_values=(vars)

View File

@ -163,8 +163,9 @@
<label class="control-label muted">Default Language</label> <label class="control-label muted">Default Language</label>
<div class="controls"> <div class="controls">
<% @site_in_use_locales.each do |locale| %> <% @site_in_use_locales.each do |locale| %>
<%= radio_button_tag "site[default_locale]", locale, @locale == locale,:class=>"toggle-check in_use_locales", :data => { :title => "#{I18nVariable.from_locale(locale)}", disabled: true } %> <%= radio_button_tag "site[default_locale]", locale, @locale == locale ,:class=>"toggle-check in_use_locales", :data => { :title => "#{I18nVariable.from_locale(locale)}" } %>
<% end %> <% end %>
</div> </div>
</div> </div>

View File

@ -3,11 +3,11 @@
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %> <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %> <%= devise_error_messages! %>
<!-- <div><%= f.label :email %><br /> <div><%= f.label :email %><br />
<%= f.email_field :email %></div> <%= f.email_field :email %></div>
-->
<div><%= f.label "Username" %><br /> <div><%= f.label "Username" %><br />
<%= f.email_field :user_id %></div> <%= f.text_field :user_id %></div>
<div><%= f.label :password %><br /> <div><%= f.label :password %><br />
<%= f.password_field :password %></div> <%= f.password_field :password %></div>

View File

@ -3,9 +3,7 @@ Orbit::Application.routes.draw do
# get "robots.txt" => 'robots#index' # get "robots.txt" => 'robots#index'
devise_for :users, :controllers => { :registrations => "registrations" } do
devise_for :users do
match "/users_passwd" => "desktop/registrations#update", :as => :users_passwd, :via => :put match "/users_passwd" => "desktop/registrations#update", :as => :users_passwd, :via => :put
end end