Class: InnerPlan::ListsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- InnerPlan::ListsController
- Defined in:
- app/controllers/inner_plan/lists_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
- #update_position ⇒ Object
Instance Method Details
#create ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/inner_plan/lists_controller.rb', line 18 def create @list = InnerPlan::List.new(list_params) @list.user = current_inner_plan_user if @list.save redirect_to lists_path else render InnerPlan::Lists::NewView.new(list: @list), status: :unprocessable_entity end end |
#edit ⇒ Object
29 30 31 32 |
# File 'app/controllers/inner_plan/lists_controller.rb', line 29 def edit @list = InnerPlan::List.root.find(params[:id]) render InnerPlan::Lists::EditView.new(list: @list) end |
#index ⇒ Object
3 4 5 6 |
# File 'app/controllers/inner_plan/lists_controller.rb', line 3 def index @lists = InnerPlan::List::Operation::Index.call[:models] render InnerPlan::Lists::IndexView.new(lists: @lists) end |
#new ⇒ Object
13 14 15 16 |
# File 'app/controllers/inner_plan/lists_controller.rb', line 13 def new @list = InnerPlan::List.new render InnerPlan::Lists::NewView.new(list: @list) end |
#show ⇒ Object
8 9 10 11 |
# File 'app/controllers/inner_plan/lists_controller.rb', line 8 def show @list = InnerPlan::List.root.find(params[:id]) render InnerPlan::Lists::ShowView.new(list: @list) end |