Sha256: 7a5651d4c08ef17e3cac06f388509df56a53b62ecba9b3f3bdf4b26fe3eddcff
Contents?: true
Size: 1.3 KB
Versions: 2
Compression:
Stored size: 1.3 KB
Contents
class UsersController < ApplicationController # GET /users # GET /users.xml def index @users = User.all respond_to do |format| format.html # index.html.erb format.xml { render :xml => @users } end end # GET /users/1 # GET /users/1.xml def show @user = User.find(params[:id]) @countries = COUNTRIES respond_to do |format| format.html # show.html.erb format.xml { render :xml => @user } end end def email_field @user = User.find(params[:id]) render :action => :email_field, :layout => false end def show_ajax @user = User.find(params[:id]) @countries = COUNTRIES end def double_init @user = User.find(params[:id]) @countries = COUNTRIES end # GET /users/1/edit def edit @user = User.find(params[:id]) end # PUT /users/1 # PUT /users/1.xml def update @user = User.find(params[:id]) respond_to do |format| if @user.update_attributes(user_params) format.html { redirect_to(@user, :notice => 'User was successfully updated.') } format.json { respond_with_bip(@user) } else format.html { render :action => "edit" } format.json { respond_with_bip(@user) } end end end private def user_params params.require(:user).permit! end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
best_in_place-3.0.0 | spec/internal/app/controllers/users_controller.rb |
best_in_place-3.0.0.rc1 | spec/internal/app/controllers/users_controller.rb |