Sha256: d13a63758a8598a06a69de99fd2aeb2a4d84fec0a9df0c28849ce00add8bae97

Contents?: true

Size: 1016 Bytes

Versions: 14

Compression:

Stored size: 1016 Bytes

Contents

class RolesController < ApplicationController
  load_and_authorize_resource

  # GET /roles
  # GET /roles.json
  def index
    respond_to do |format|
      format.html # index.html.erb
      format.json { render :json => @roles }
    end
  end

  # GET /roles/1
  # GET /roles/1.json
  def show
    respond_to do |format|
      format.html # show.html.erb
      format.json { render :json => @role }
    end
  end

  # GET /roles/1/edit
  def edit
  end

  # PUT /roles/1
  # PUT /roles/1.json
  def update
    if params[:move]
      move_position(@role, params[:move])
      return
    end

    respond_to do |format|
      if @role.update_attributes(params[:role])
        format.html { redirect_to @role, :notice => t('controller.successfully_updated', :model => t('activerecord.models.role')) }
        format.json { head :no_content }
      else
        format.html { render :action => "edit" }
        format.json { render :json => @role.errors, :status => :unprocessable_entity }
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
enju_leaf-1.1.0.rc12 app/controllers/roles_controller.rb
enju_leaf-1.1.0.rc11 app/controllers/roles_controller.rb
enju_leaf-1.1.0.rc10 app/controllers/roles_controller.rb
enju_leaf-1.1.0.rc9 app/controllers/roles_controller.rb
enju_leaf-1.1.0.rc8 app/controllers/roles_controller.rb
enju_leaf-1.1.0.rc7 app/controllers/roles_controller.rb
enju_leaf-1.1.0.rc6 app/controllers/roles_controller.rb
enju_leaf-1.1.0.rc5 app/controllers/roles_controller.rb
enju_leaf-1.1.0.rc4 app/controllers/roles_controller.rb
enju_leaf-1.1.0.rc3 app/controllers/roles_controller.rb
enju_leaf-1.1.0.rc2 app/controllers/roles_controller.rb
enju_leaf-1.1.0.rc1 app/controllers/roles_controller.rb
enju_leaf-1.1.0.beta3 app/controllers/roles_controller.rb
enju_leaf-1.1.0.pre3 app/controllers/roles_controller.rb