Class: IshManager::IroPositionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- IshManager::IroPositionsController
- Defined in:
- app/controllers/ish_manager/iro_positions_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/ish_manager/iro_positions_controller.rb', line 6 def create @position = Iro::Position.new({ type: 'Iro::CoveredCall', }) :update, @position if @position.update params[:iro_position].permit! flash[:notice] = 'Successfully updated position.' redirect_to controller: 'iro_purses', action: :show, id: params[:iro_position][:iro_purse_id] else flash[:alert] = "Cannot update position: #{@position.errors.full_messages.join(', ')}." render action: 'edit' end end |
#edit ⇒ Object
21 22 23 24 |
# File 'app/controllers/ish_manager/iro_positions_controller.rb', line 21 def edit @position = Iro::Position.find params[:id] :edit, @position end |
#new ⇒ Object
26 27 28 29 |
# File 'app/controllers/ish_manager/iro_positions_controller.rb', line 26 def new @position = Iro::Position.new :new, @position end |
#update ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'app/controllers/ish_manager/iro_positions_controller.rb', line 31 def update @position = Iro::Position.find params[:id] :update, @position if @position.update params[:iro_position].permit! flash[:notice] = 'Successfully updated position.' redirect_to controller: 'iro_purses', action: :show, id: @position[:iro_purse_id] else flash[:alert] = "Cannot update position: #{@position.errors.full_messages.join(', ')}." render action: 'edit' end end |