Module: Authentasaurus::UsersController::InstanceMethods
- Defined in:
- lib/authentasaurus/users_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/authentasaurus/users_controller.rb', line 35 def create @user = User.new params[:user] respond_to do |format| if @user.save format.html { redirect_to :action=>:index, :notice => "User saved successfully" } else flash.now[:alert] = I18n.t(:create_failed, :scope => [:authentasaurus, :messages, :users]) format.html { render :new } end end end |
#destroy ⇒ Object
69 70 71 72 73 74 75 76 |
# File 'lib/authentasaurus/users_controller.rb', line 69 def destroy @user = User.find params[:id] @user.destroy respond_to do |format| format.html { redirect_to :action=>:index } end end |
#edit ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/authentasaurus/users_controller.rb', line 48 def edit @user = User.find params[:id] respond_to do |format| format.html end end |
#index ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/authentasaurus/users_controller.rb', line 11 def index @users = User.all respond_to do |format| format.html end end |
#new ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/authentasaurus/users_controller.rb', line 27 def new @user = User.new respond_to do |format| format.html end end |
#show ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/authentasaurus/users_controller.rb', line 19 def show @user = User.find(params[:id]) respond_to do |format| format.html end end |
#update ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/authentasaurus/users_controller.rb', line 56 def update @user = User.find params[:id] respond_to do |format| if @user.update_attributes(params[:user]) format.html { redirect_to :action => :index, :notice => "User updated" } else flash.now[:alert] = I18n.t(:update_failed, :scope => [:authentasaurus, :messages, :users]) format.html { render :edit } end end end |