-
-
Save myobie/9487365 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TasksController | |
def index | |
Task.where(IndexParams.new(params).params) | |
end | |
def create | |
Task.create!(CreateParams.new(params).params) | |
end | |
private | |
class IndexParams | |
include StarkParameters | |
require one: [:list_id, :user_id] | |
end | |
class CreateParams | |
include StarkParameters | |
require :assignee_id | |
require :title, as: :task_content | |
permit :due_date | |
permit :important, as: :starred | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment