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

第135回 がく みなみや ゆかお #1433

Closed
ManabuSeki opened this issue Oct 15, 2018 · 13 comments
Closed

第135回 がく みなみや ゆかお #1433

ManabuSeki opened this issue Oct 15, 2018 · 13 comments

Comments

@ManabuSeki
Copy link

No description provided.

@ManabuSeki
Copy link
Author

hi 😄

@yuki3738 yuki3738 changed the title 第135回 がく みなみや ゆかお 第135回 がく みなみや ゆかお Oct 15, 2018
@yuki3738
Copy link
Contributor

💪

@ManabuSeki
Copy link
Author

2.2 Usersリソースから

@yucao24hours
Copy link
Member

#124

@yucao24hours
Copy link
Member

#251

@yuki3738
Copy link
Contributor

演習1
img_3102

@yuki3738
Copy link
Contributor

演習2
これじゃろ?
@user = User.find(params[:id])

@yuki3738
Copy link
Contributor

演習3
/toy_app/app/views/users/edit.html.erb

/toy_app/app/views/users/_form.html.erb

@yuki3738
Copy link
Contributor

理解が困難。 scaffoldのコードを理解できるぐらいなら、そもそも本書を読む必要はないでしょう。

おぅよ。

@yuki3738
Copy link
Contributor

ほげほげ〜!!!!!

@yuki3738
Copy link
Contributor

演習1
<p id="notice">Micropost was successfully created.</p>

@yuki3738
Copy link
Contributor

上記まで↑

@ManabuSeki
Copy link
Author

演習1

toy_app/app/controllers/microposts_controller.rb 29行目から

respond_to do |format|
      if @micropost.save
        format.html { redirect_to @micropost, notice: 'Micropost was successfully created.' }
        format.json { render :show, status: :created, location: @micropost }
      else
        format.html { render :new }
        format.json { render json: @micropost.errors, status: :unprocessable_entity }
      end
    end

toy_app/app/views/microposts/show.html.erb 1行目

<p id="notice"><%= notice %></p>

createでnoticeに渡した文字列がviewの<%= notice %>ERB(eRuby)で文字列を出力している

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

No branches or pull requests

3 participants