Sha256: d547fc1cfa93b7548439821ea850a73cf1be61eba86c2185fac104847da9db0d
Contents?: true
Size: 549 Bytes
Versions: 2
Compression:
Stored size: 549 Bytes
Contents
class TodosController::Create < BaseAction def default_view_data super.merge({todo: todo}) end def perform return build_view(Home::ShowRedirect) unless current_user return build_view(Defaults::BadRequestView, errors: [todo_params.error_message]) unless todo_params.fetch if todo.save build_view(Todos::IndexRedirect) else build_view(Todos::NewView) end end private def todo @todo ||= Todo.new(todo_params.fetch) end def todo_params TodosController::TodoParams.build(params) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
aldous-1.0.1 | examples/basic_todo/app/controller_actions/todos_controller/create.rb |
aldous-1.0.0 | examples/basic_todo/app/controller_actions/todos_controller/create.rb |