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

Finished CRUD for Article #5

Closed
wants to merge 1 commit into from
Closed

Conversation

hardikupadhyay16
Copy link
Collaborator

  • Created CRUD for article
  • changed column type for long description in article model

Copy link
Collaborator

@KanjariyaHardik KanjariyaHardik left a comment

Choose a reason for hiding this comment

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

Please make changes to code structure

@@ -0,0 +1,2 @@
json.extract! article, :id, :created_at, :updated_at
json.url article_url(article, format: :json)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Need Space Here

Copy link
Owner

@charusat09 charusat09 Sep 28, 2016

Choose a reason for hiding this comment

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

@hardikupadhyay16 @uzaif313 I think we don't need this at all...

@@ -0,0 +1 @@
json.array! @articles, partial: 'articles/article', as: :article
Copy link
Collaborator

Choose a reason for hiding this comment

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

Space here at the end of file

@@ -0,0 +1 @@
json.partial! "articles/article", article: @article
Copy link
Collaborator

Choose a reason for hiding this comment

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

Space here at the end of file

@article = current_user.articles.build(article_params)
respond_to do |format|
if @article.save
if params[:images].present?
Copy link
Owner

Choose a reason for hiding this comment

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

@uzaif313 can you please extract this code to new private method i.e. save_image(image_param) ?

respond_to do |format|
if @article.update(article_params)
if params[:images].present?
@article.pictures.destroy_all
Copy link
Owner

Choose a reason for hiding this comment

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

@uzaif313 same here..

@charusat09
Copy link
Owner

@uzaif313 @hardikupadhyay16 @chaudharyprakash Do we need view template any more ??

@charusat09
Copy link
Owner

@hardikupadhyay16 @uzaif313 @chaudharyprakash also resolve this issue within this branch only..

@uzaif313
Copy link
Collaborator

this branch is for web not for API

@charusat09
Copy link
Owner

Done

@charusat09 charusat09 closed this Oct 3, 2016
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.

4 participants