1 class RolesController < ApplicationController
8 format.html # index.html.erb
9 format.xml { render :xml => @roles }
16 @role = Role.find(params[:id])
18 respond_to do |format|
19 format.html # show.html.erb
20 format.xml { render :xml => @role }
29 respond_to do |format|
30 format.html # new.html.erb
31 format.xml { render :xml => @role }
37 @role = Role.find(params[:id])
43 @role = Role.new(params[:role])
45 respond_to do |format|
47 format.html { redirect_to(@role, :notice => 'Role was successfully created.') }
48 format.xml { render :xml => @role, :status => :created, :location => @role }
50 format.html { render :action => "new" }
51 format.xml { render :xml => @role.errors, :status => :unprocessable_entity }
59 @role = Role.find(params[:id])
61 respond_to do |format|
62 if @role.update_attributes(params[:role])
63 format.html { redirect_to(@role, :notice => 'Role was successfully updated.') }
64 format.xml { head :ok }
66 format.html { render :action => "edit" }
67 format.xml { render :xml => @role.errors, :status => :unprocessable_entity }
75 @role = Role.find(params[:id])
78 respond_to do |format|
79 format.html { redirect_to(roles_url) }
80 format.xml { head :ok }