I am a beginner who has been studying for 2 weeks.
I am creating a profile page for a home page that is ruby on rails.
def show @user = User.find(params[:id]) @post_images = @user.post_images.page(params[:page]).reverse_order end
resources :users, only: [:show, :edit, :update]
User info <%= @user.name %> <%= attachment_image_tag @user, :profile_image, :fill, 100, 100, format:'jpeg', class: "img-circle pull-left profile-img", fallback: "no_image.jpg" %> <% if @user.id == current_user.id %> <p><%= link_to "EDIT, edit_user_path(user), class: "pull-right" %></p> <% end %>
I got an error like this.
I did a lot of research, but I don't know how to solve it, and I would appreciate it if you could tell me something.
Answer # 1
Isn't there just no User with id=1 as per the error message?
- i have a question about ruby yield from the introduction to ruby for those who want to become a book professional
- ruby on rails - about variable error of rails like function
- ruby on rails - [rails] about the display position after redirect by pressing like
- ruby - about errors after deploying heroku
- ruby - about the error when there is no id of the association destination
- ruby on rails - about rails:
- ruby on rails - about routing errors in devise
- ruby on rails - about rails unit test code
- ruby on rails - about the code of the adjacency list model implemented in rails
- ruby on rails - about the problem that rails test does not become green in rails tutorial
- ruby - i have a question about rails routing errors
- ruby on rails: about nomethoderror that occurred when adding a good function
- ruby - about integration test errors
- ruby on rails - about bundler of dockerfile when deploying rails application to ec2
- ruby on rails 5 - about the structure when creating a blog with rails 5
- ruby - about form_with of doubly nested routing
- about the empty model created by "new" of ruby on rails
- ruby - about active storage
- about reverse sorting of ruby array elements (code problem)
- ruby - about an infinite loop in a while statement
- ruby - an error occurred when implementing the micropost search function using ransack
- ruby - [rspec] error in "dependent: destoy" test: how to resolve "validation failed"
- ruby - when i run rails s, i get a message like error loading the'sqlite3' and the server doesn't start properly
- ruby - sass :: syntaxerror on rails s
- ruby - about accelerating heroku's rails app
- ruby - how to upload images directly from rails to s3 on aws
- ruby - [rails] i can't install the add favorite button
- ruby - [rails] when rails s is executed, an error "cannot load database configuration" appears and it is forcibly term
- ruby - http error 500 error occurred in aws deployment, but the cause cannot be determined