Module ResourceController::Actions
In: ../lib/resource_controller/actions.rb

Methods

create   destroy   edit   index   new   show   update  

Public Instance methods

[Source]

    # File ../lib/resource_controller/actions.rb, line 18
18:     def create
19:       build_object
20:       load_object
21:       before :create
22:       if object.save
23:         after :create
24:         set_flash :create
25:         response_for :create
26:       else
27:         after :create_fails
28:         set_flash :create_fails
29:         response_for :create_fails
30:       end
31:     end

[Source]

    # File ../lib/resource_controller/actions.rb, line 60
60:     def destroy
61:       load_object
62:       before :destroy
63:       if object.destroy
64:         after :destroy
65:         set_flash :destroy
66:         response_for :destroy
67:       else
68:         after :destroy_fails
69:         set_flash :destroy_fails
70:         response_for :destroy_fails
71:       end
72:     end

[Source]

    # File ../lib/resource_controller/actions.rb, line 54
54:     def edit
55:       load_object
56:       before :edit
57:       response_for :edit
58:     end

[Source]

   # File ../lib/resource_controller/actions.rb, line 4
4:     def index
5:       load_collection
6:       before :index
7:       response_for :index
8:     end

[Source]

    # File ../lib/resource_controller/actions.rb, line 47
47:     def new
48:       build_object
49:       load_object
50:       before :new_action
51:       response_for :new_action
52:     end

[Source]

    # File ../lib/resource_controller/actions.rb, line 10
10:     def show
11:       load_object
12:       before :show
13:       response_for :show
14:     rescue ActiveRecord::RecordNotFound
15:       response_for :show_fails
16:     end

[Source]

    # File ../lib/resource_controller/actions.rb, line 33
33:     def update
34:       load_object
35:       before :update
36:       if object.update_attributes object_params
37:         after :update
38:         set_flash :update
39:         response_for :update
40:       else
41:         after :update_fails
42:         set_flash :update_fails
43:         response_for :update_fails
44:       end
45:     end

[Validate]