Permalink
Browse files

Few changes (square 1)

  • Loading branch information...
1 parent 26524a7 commit 6780eb2531bc9270f869ce929c0da5573e4a3224 Yogesh Pandit committed Mar 9, 2012
Showing with 16 additions and 11 deletions.
  1. +7 −5 app/controllers/registration_controller.rb
  2. +2 −0 app/views/registration/_form.html.erb
  3. +7 −6 config/routes.rb
@@ -7,16 +7,16 @@ def index
end
def new
- @user = User.new
+ # @user = User.new
email = params[:user_session][:email] if ! params[:user_session].nil?
email ||= params[:email]
password = params[:user_session][:password] if ! params[:user_session].nil?
@user = User.new(:password=>password, :email=>email )
- # respond_to do |format|
- # format.html # new.html.erb
- # format.xml { render :xml => @user }
- # end
+ respond_to do |format|
+ format.html # new.html.erb
+ format.xml { render :xml => @user }
+ end
end
def create
@@ -51,6 +51,8 @@ def show
end
def update
+ email = params[:user_session][:email] if ! params[:user_session].nil?
+ # @register = User.new (:email => email)
end
end
@@ -1,3 +1,5 @@
+<% content_for :title, "Dicty12: Registration Form" %>
+
<%= form_for(@user) do |f| %>
<!-- <#% if @register.errors.any? %>
View
@@ -1,25 +1,26 @@
Dicty11::Application.routes.draw do
root :to => "home#index"
- # get "attendee/register"
match '/login' => 'user_sessions#new', :as => :login
match '/logout' => 'user_sessions#destroy', :as => :logout
match '/admin' => 'user_sessions#admin', :as => :admin
- match '/register' => 'registration#new', :as => :register
- match '/users/:id', :to => 'users#show', :as => :user
+ match '/register' => 'registration#update', :as => :register
+ # match '/users/:id', :to => 'users#show', :as => :user
resources :user_sessions
+ resources :users
resources :registration
resources :abstracts
+
resources :user_sessions do
resources :abstracts
end
- resources :user do
- resources :registration
- end
+ # resources :users do
+ # resources :registration
+ # end
#match '/registration' => 'home#registration', :as => :registration
match '/agenda' => 'home#agenda', :as => :agenda

0 comments on commit 6780eb2

Please sign in to comment.