I am making a web application with rails.
I would like to make a long YouTube video with a separate page for each chapter.
Click on a thumbnail to access the playback page for that chapter.
When you hit the page in the format of "/ movies /: id/chapters /: id", you can jump to a page where only a part of a long movie can be played.
I would like to access the specified movie page by passing the argument to the "movie_chapter_path" presented in the helper method.
movie_chapter_path GET/movies /: movie_id/chapters /: id (.: format)
Applicable source code
▼/app/views/dashboard/index.html.haml
= render partial: 'layouts/movie-box', collection: @chapter, as: 'chapter'
▼/app/views/layouts/_movie-box.html.haml
% li.movie-box--list
= link_to movie_chapter_path (movie, chapter) do
SinceThe part where movie id is entered is output as "% 23% 3CMovie :: ActiveRecord_Relation: 0x00007ff2583d1308% 3E".
In other words, a URL like this has been displayed.
"/ Movies /% 23% 3CMovie :: ActiveRecord_Relation: 0x00007ff2583d1308% 3E/chapters/544"
I think it's because you didn't pass a movie argument,
= render partial: 'layouts/movie-box', collection: @chapter, as: 'chapter'
I can't tell if I can't search for this multiple specification method.
I want to know if you know anyone!
I searched, but I didn't get the information I wanted.
-
Answer # 1
Related articles
- ruby - use form_with in rails to specify multiple models and save values
- ruby - rails i want to search by multiple keywords
- ruby on rails - extract multiple specific columns from one activerecord and make them json
- ruby on rails multiple keyword search i don't know how to write
- ruby on rails - [rails] how to specify the number of date_select to be displayed
- ruby on rails 5 - wrong number of arguments (given 0, expected 1) cannot be resolved
- ruby - rails i want to make the created_at time the same when creating multiple data at once
- ruby - how to specify the range of rails! =
- ruby on rails - phenomenon that the test that should be an "rspec" error passes
- ruby on rails - even though i can log in with rails, the current_user specified in the user details view becomes nil and an erro
- ruby on rails - eliminate duplication of a particular column in your rails model and calculate each sum of different columns
- ruby - i can't install ffi with everyday rails setup
- ruby on rails 6 - i want to change the display of the product detail page according to the user's conditions
- ruby on rails - [rails] how to round (omission and display) the character string of link_to
- ruby on rails - i get an error with rails db: create
- ruby on rails - no route matches , missing required keys: [: id] cannot be resolved
- ruby on rails - when a photo is added to a folder on the pc, i want to display it on the browser of the web application!
- ruby - rails db: migrate is not possible
- ruby on rails - rails tutorial chapter 13 cooperation between heroku and aws s3 region
- ruby on rails - i want to solve the problem that "we're sorry, but something went wrong" is displayed in the productio
▼/app/views/layouts/_movie-box.html.haml
↓
After making this correction, it appears!