Class RoleAssignmentsController
In: app/controllers/role_assignments_controller.rb
Parent: GenericRestController

Methods

Public Instance methods

[Source]

    # File app/controllers/role_assignments_controller.rb, line 41
41:   def create
42:     self.resource = new_resource
43:     resource.save!
44:     respond_to do |format|
45:       format.html do
46:         flash[:notice] = "#{resource_name.humanize} was successfully created."
47:         redirect_to resource_url
48:       end
49:       format.js   { index }
50:       format.xml  { head :created, :location => resource_url }
51:     end
52:   end

[Source]

    # File app/controllers/role_assignments_controller.rb, line 54
54:   def destroy
55:     self.resource = find_resource
56:     resource.destroy
57:     respond_to do |format|
58:       format.html do
59:         flash[:notice] = "#{resource_name.humanize} was successfully destroyed."
60:         redirect_to resources_url
61:       end
62:       format.js   { index }
63:       format.xml  { head :ok }
64:     end
65:   end

Resources Controller doesn‘t really do the right thing for us on AJAX, so…

[Source]

    # File app/controllers/role_assignments_controller.rb, line 30
30:   def index
31:     self.resources = find_resources
32: 
33:     respond_to do |format|
34:       format.html # index.rhtml
35:       format.js   { render :action => 'index', :layout => false }
36:       format.xml  { render :xml => resources.to_xml }
37:     end
38:     self.resources = find_resources
39:   end

Protected Instance methods

[Source]

    # File app/controllers/role_assignments_controller.rb, line 86
86:   def can_edit?( x ); false; end

[Source]

    # File app/controllers/role_assignments_controller.rb, line 72
72:   def js_render_args( action )
73: 
74:     # Always show the full assignment list when redisplaying within the 
75:     # users page...
76: 
77:     return { :action => "index", :layout => false }
78: 
79:   end

[Source]

    # File app/controllers/role_assignments_controller.rb, line 81
81:   def new_resource( attrs = params[:role_assignment] )
82:     ra_params = (attrs || {}).merge( :user => enclosing_resource )
83:     RoleAssignment.new ra_params
84:   end

[Validate]