Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CK app #23

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

CK app #23

wants to merge 6 commits into from

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.

2 participants