Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
624 recent updates feed on main page #626
624 recent updates feed on main page #626
Changes from 10 commits
c90f66d
66675ef
8d876dd
3febd8f
4d3d86e
f3e839c
4eb47fa
5312c8b
d7631f3
3352296
563c530
c6e5829
e828d4f
ed1f733
abe8300
c12b0cc
0ebe46a
98b8dd9
b64d493
e70dda8
13981b7
43857be
4f2a84d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you already have a
create
method you don't needstore
, this method can be deleted.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
show
is a method that fetches one instance of the model. For example, clicking on a blog post title to view the full post. Since we don't need such a method in this context, this can be deleted.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to be able to edit, but it's not too important at the moment, since we have database access if we really need to edit the text. This method can be deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have a method for
update
andedit
, I would expect those to both perform the same function. You really only need one, if any. Since we don't need this you can just delete this method.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code belongs in
index()
. On that note, take some time to learn about CRUD, a general design model. At a very basic level, the idea is that there are four basic operations we perform on data - Create, Read, Update, Delete. This means one method for each of those operations. In our apps we add one more, a method specifically for fetching multiple, and we call that index(). So, almost all of our controllers containindex()
,show()
,create()
,update()
, anddelete()
. Some purists even argue that if you need more methods than that per controller, you need to refactor! I think that's very extreme. But following the model, most of the time, is helpful I think.