Sha256: 1525b0985f71a95aaf1e335357b77af19d89dd3fbe33962048342826360d28f9

Contents?: true

Size: 942 Bytes

Versions: 1

Compression:

Stored size: 942 Bytes

Contents

class UsersController < ApplicationController

  def show
    @user = User.find_by_permalink!(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @user }
    end
	end

  def edit
    @user = User.find_by_permalink!(params[:id])

    respond_to do |format|
      format.html # edit.html.erb
      format.xml  { render :xml => @user }
    end
  end
  
  def update
    
    @user = User.find_by_permalink!(params[:id])

    respond_to do |format|
      if @user.update_attributes(params[:user])
        #format.html { redirect_to(@user, :notice => 'User was successfully updated.') }
        format.html { render :action => "edit", :notice => 'User was successfully updated.' }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @user.errors, :status => :unprocessable_entity }
      end
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
social_stream-0.2.2 app/controllers/users_controller.rb