link_toの第二要素に関しての質問です。下記のlinkの第二要素[]はどのような要素を入れればよろしいのでしょうか?第二要素はパスを指定するものであるということは理解しているのですが[]にあまり馴染みがありません。
<%= link_to entry.author.name, [entry.author, :entries] %> <%= link_to "削除", [:unlike, entry], method: :patch, data: { confirm: "削除しますか?" } %>
Prefix Verb URI Pattern Controller#Action root GET / top#index about GET /about(.:format) top#about bad_request GET /bad_request(.:format) top#bad_request forbidden GET /forbidden(.:format) top#forbidden internal_server_error GET /internal_server_error(.:format) top#internal_server_error GET /lesson/step1(/:name)(.:format) lesson#step1 GET /lesson/step2(/:name)(.:format) lesson#step2 GET /lesson/step3(/:name)(.:format) lesson#step3 GET /lesson/step4(/:name)(.:format) lesson#step4 GET /lesson/step5(/:name)(.:format) lesson#step5 GET /lesson/step6(/:name)(.:format) lesson#step6 GET /lesson/step7(/:name)(.:format) lesson#step7 GET /lesson/step8(/:name)(.:format) lesson#step8 GET /lesson/step9(/:name)(.:format) lesson#step9 GET /lesson/step10(/:name)(.:format) lesson#step10 GET /lesson/step11(/:name)(.:format) lesson#step11 GET /lesson/step12(/:name)(.:format) lesson#step12 GET /lesson/step13(/:name)(.:format) lesson#step13 GET /lesson/step14(/:name)(.:format) lesson#step14 GET /lesson/step15(/:name)(.:format) lesson#step15 GET /lesson/step16(/:name)(.:format) lesson#step16 GET /lesson/step17(/:name)(.:format) lesson#step17 GET /lesson/step18(/:name)(.:format) lesson#step18 search_members GET /members/search(.:format) members#search member_entries GET /members/:member_id/entries(.:format) entries#index members GET /members(.:format) members#index POST /members(.:format) members#create new_member GET /members/new(.:format) members#new edit_member GET /members/:id/edit(.:format) members#edit member GET /members/:id(.:format) members#show PATCH /members/:id(.:format) members#update PUT /members/:id(.:format) members#update DELETE /members/:id(.:format) members#destroy session DELETE /session(.:format) sessions#destroy POST /session(.:format) sessions#create edit_account GET /account/edit(.:format) accounts#edit account GET /account(.:format) accounts#show PATCH /account(.:format) accounts#update PUT /account(.:format) accounts#update edit_password GET /password/edit(.:format) passwords#edit password GET /password(.:format) passwords#show PATCH /password(.:format) passwords#update PUT /password(.:format) passwords#update articles GET /articles(.:format) articles#index POST /articles(.:format) articles#create new_article GET /articles/new(.:format) articles#new edit_article GET /articles/:id/edit(.:format) articles#edit article GET /articles/:id(.:format) articles#show PATCH /articles/:id(.:format) articles#update PUT /articles/:id(.:format) articles#update DELETE /articles/:id(.:format) articles#destroy like_entry PATCH /entries/:id/like(.:format) entries#like unlike_entry PATCH /entries/:id/unlike(.:format) entries#unlike voted_entries GET /entries/voted(.:format) entries#voted entries GET /entries(.:format) entries#index POST /entries(.:format) entries#create new_entry GET /entries/new(.:format) entries#new edit_entry GET /entries/:id/edit(.:format) entries#edit entry GET /entries/:id(.:format) entries#show PATCH /entries/:id(.:format) entries#update PUT /entries/:id(.:format) entries#update DELETE /entries/:id(.:format) entries#destroy
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/12/18 07:32
退会済みユーザー
2019/12/18 07:40
2019/12/18 08:30