Skip to content

Conversation

@chriskuck
Copy link

No description provided.

@chriskuck
Copy link
Author

@jaybobo

@chriskuck chriskuck changed the title Initial app CK app Dec 12, 2017
Copy link
Member

@jaybobo jaybobo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. There are a couple of rails specific things I noticed. I left your JS alone :P

FYI, this is a thing: http://edgeguides.rubyonrails.org/api_app.html

end

def show
@task = Task.find(params[:id])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. we might clean up lines 9, 23 & 33 with a before_action.
see: http://api.rubyonrails.org/classes/AbstractController/Callbacks/ClassMethods.html


def create
@task = Task.new(task_params)
if @task.valid?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.save! will run validations in this case. you can save yourself a line here.

See: http://api.rubyonrails.org/classes/ActiveRecord/Persistence.html#method-i-save-21


def update
@task = Task.find(params[:id])
@task.update(task_params)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants