Home>
We are currently creating a ToDo application with a personal application. The task is nested in the list, and the link to the detail page of the task is
It's supposed to be funny. Originally, I want to say "/lists/1/tasks/1", but "/lists/1/tasks.1" and the link destination are displayed. The argument of link_to was reversed yesterday, but it is a normal link destination. When rails is launched today, such a phenomenon occurs.
I want to cure a strange link
Today's link Link of yesterday Applicable source codeExcerpts that seem to have a relationship
tasks_controller.rb
def show
@task = @list.tasks.find(params[:task_id])
end
lists/index
<% @lists.each do |list| %>
~abridgement~
<% list.tasks.each do |task| %>
<%= task.title %>
<%= link_to list_tasks_path(list.id, task.id), method: :get do %>
<i></i>
<% end %>
<% end %>
<% end %>
What I tried
I wonder if the argument is wrong,
<%= link_to list_tasks_path(list.id, task.id), method: :get do %>
When I tried to list.tasks.ids, I found a destination I didn't quite understand like list/1%2F2%2F3%2F4%2F5%2F6%2F7%2F8/tasks.1.
-
Answer # 1
Related articles
- ruby on rails - i want to be able to get the information of the link destination by pressing the link in rails
- ruby - [rails] duplicate column name: it is displayed as reset_sent_at, but i do not know the duplicated part
- [ruby on rails] the page is not displayed after connecting to the server on aws cloud9
- ruby on rails 5 - f the value sent in hidden_field is not displayed
- ruby on rails 6 - i want the posted prototype to be displayed on the top page
- ruby on rails - [rails] the initial image of the icon for the user is not displayed
- ruby on rails - the graph is not displayed well in the app using rails a 0 will be entered in the date when no data is entered,
- ruby on rails - the image is not displayed on the article details screen sprockets :: rails :: helper :: assetnotfound
- ruby - partial template is not displayed (rails)
- ruby on rails - when i make a message, i want the date to be displayed, but i get "undefined method` strftime' for nil: nil
- ruby on rails - [rails] i want to solve "no route matches [post]"/messages/search "" of "routing error&
- ruby - data is not updated by update action rails
- ruby - use form_with in rails to specify multiple models and save values
- ruby on rails - rails60 i can't log in
- ruby on rails - nomethoderror in itemscontroller # new error
- ruby - i can't transition to my page for each user after logging out (rails)
- ruby on rails - i get an error without being created
- ruby on rails 6 - when i press new user registration, i get an error of no route matches [get] "/ users"
- ruby on rails - i want to write a rails tutorial test in rspec
- ruby on rails - how to debug with rails pry in docker environment
Trends
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- python - you may need to restart the kernel to use updated packages error
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- python 3x - typeerror: 'method' object is not subscriptable
- javascript - how to check if an element exists in puppeteer
- xcode - pod install [!] no `podfile 'found in the project directory
- i want to call a child component method from a parent in vuejs
- vuejs - [vuetify] unable to locate target [data-app] i want to unit test to avoid warning
list_tasks_path
Notlist_task_path
What about?