Class: SparklyAccountsController
- Inherits:
-
SparklyController
- Object
- SparklyController
- SparklyAccountsController
- Defined in:
- app/controllers/sparkly_accounts_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST model_url.
-
#destroy ⇒ Object
DELETE model_url.
-
#edit ⇒ Object
GET edit_model_url.
-
#new ⇒ Object
GET new_model_url.
-
#show ⇒ Object
GET model_url.
-
#update ⇒ Object
PUT model_url.
Instance Method Details
#create ⇒ Object
POST model_url
10 11 12 13 14 15 16 17 |
# File 'app/controllers/sparkly_accounts_controller.rb', line 10 def create if model.save login!(model) redirect_back_or_default Auth.default_destination, Auth. else render :action => 'new' end end |
#destroy ⇒ Object
DELETE model_url
42 43 44 45 46 47 48 |
# File 'app/controllers/sparkly_accounts_controller.rb', line 42 def destroy current_user && current_user.destroy logout! @current_user = nil flash[:notice] = Auth. redirect_back_or_default Auth.default_destination end |
#edit ⇒ Object
GET edit_model_url
24 25 |
# File 'app/controllers/sparkly_accounts_controller.rb', line 24 def edit end |
#new ⇒ Object
GET new_model_url
6 7 |
# File 'app/controllers/sparkly_accounts_controller.rb', line 6 def new end |
#show ⇒ Object
GET model_url
20 21 |
# File 'app/controllers/sparkly_accounts_controller.rb', line 20 def show end |
#update ⇒ Object
PUT model_url
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/controllers/sparkly_accounts_controller.rb', line 28 def update if !model_params[:password].blank? || !model_params[:password_confirmation].blank? model.password = model_params[:password] model.password_confirmation = model_params[:password_confirmation] end if model.save redirect_back_or_default user_path, Auth. else render :action => 'edit' end end |