Module: Outpost::Controller::Actions
- Defined in:
- lib/outpost/controller/actions.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/outpost/controller/actions.rb', line 29 def create @record = model.new(form_params) if @record.save notice "Saved #{@record.simple_title}" respond_with :outpost, @record, location: requested_location else "New" render :new end end |
#destroy ⇒ Object
51 52 53 54 55 |
# File 'lib/outpost/controller/actions.rb', line 51 def destroy @record.destroy notice "Deleted #{@record.simple_title}" respond_with :outpost, @record end |
#edit ⇒ Object
24 25 26 27 |
# File 'lib/outpost/controller/actions.rb', line 24 def edit "Edit", nil, @record.to_title respond_with :outpost, @record end |
#index ⇒ Object
10 11 12 |
# File 'lib/outpost/controller/actions.rb', line 10 def index respond_with :outpost, @records end |
#new ⇒ Object
14 15 16 17 18 |
# File 'lib/outpost/controller/actions.rb', line 14 def new "New" @record = model.new respond_with :outpost, @record end |
#show ⇒ Object
20 21 22 |
# File 'lib/outpost/controller/actions.rb', line 20 def show redirect_to @record.admin_edit_path end |
#update ⇒ Object
41 42 43 44 45 46 47 48 49 |
# File 'lib/outpost/controller/actions.rb', line 41 def update if @record.update_attributes(form_params) notice "Saved #{@record.simple_title}" respond_with :outpost, @record, location: requested_location else "Edit", nil, @record.to_title render :edit end end |