@comment = @commentable.comments.new comment_params @comment.user = current_user @comment.save redirect_to @commentable,:anchor => '#comments'
耙路
Prefix Verb URI Pattern Controller#Action rate POST /rate(.:format) rater#create new_user_session GET /users/sign_in(.:format) devise/sessions#new user_session POST /users/sign_in(.:format) devise/sessions#create destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy user_password POST /users/password(.:format) devise/passwords#create new_user_password GET /users/password/new(.:format) devise/passwords#new edit_user_password GET /users/password/edit(.:format) devise/passwords#edit PATCH /users/password(.:format) devise/passwords#update PUT /users/password(.:format) devise/passwords#updatecancel_user_registration GET /users/cancel(.:format) devise/registrations#cancel user_registration POST /users(.:format) devise/registrations#create new_user_registration GET /users/sign_up(.:format) devise/registrations#new edit_user_registration GET /users/edit(.:format) devise/registrations#edit PATCH /users(.:format) devise/registrations#update PUT /users(.:format) devise/registrations#update DELETE /users(.:format) devise/registrations#destroy root GET / welcome#index artists GET /artists(.:format) artists#index POST /artists(.:format) artists#create new_artist GET /artists/new(.:format) artists#new edit_artist GET /artists/:ID/edit(.:format) artists#edit artist GET /artists/:ID(.:format) artists#show PATCH /artists/:ID(.:format) artists#update PUT /artists/:ID(.:format) artists#update DELETE /artists/:ID(.:format) artists#destroy album_comments GET /albums/:album_ID/comments(.:format) albums/comments#index POST /albums/:album_ID/comments(.:format) albums/comments#create new_album_comment GET /albums/:album_ID/comments/new(.:format) albums/comments#new edit_album_comment GET /albums/:album_ID/comments/:ID/edit(.:format) albums/comments#edit album_comment GET /albums/:album_ID/comments/:ID(.:format) albums/comments#show PATCH /albums/:album_ID/comments/:ID(.:format) albums/comments#update PUT /albums/:album_ID/comments/:ID(.:format) albums/comments#update DELETE /albums/:album_ID/comments/:ID(.:format) albums/comments#destroy albums GET /albums(.:format) albums#index POST /albums(.:format) albums#create new_album GET /albums/new(.:format) albums#new edit_album GET /albums/:ID/edit(.:format) albums#edit album GET /albums/:ID(.:format) albums#show PATCH /albums/:ID(.:format) albums#update PUT /albums/:ID(.:format) albums#update DELETE /albums/:ID(.:format) albums#destroy song_comments GET /songs/:song_ID/comments(.:format) songs/comments#index POST /songs/:song_ID/comments(.:format) songs/comments#create new_song_comment GET /songs/:song_ID/comments/new(.:format) songs/comments#new edit_song_comment GET /songs/:song_ID/comments/:ID/edit(.:format) songs/comments#edit song_comment GET /songs/:song_ID/comments/:ID(.:format) songs/comments#show PATCH /songs/:song_ID/comments/:ID(.:format) songs/comments#update PUT /songs/:song_ID/comments/:ID(.:format) songs/comments#update DELETE /songs/:song_ID/comments/:ID(.:format) songs/comments#destroy songs GET /songs(.:format) songs#index POST /songs(.:format) songs#create new_song GET /songs/new(.:format) songs#new edit_song GET /songs/:ID/edit(.:format) songs#edit song GET /songs/:ID(.:format) songs#show PATCH /songs/:ID(.:format) songs#update PUT /songs/:ID(.:format) songs#update DELETE /songs/:ID(.:format) songs#destroy GET /get_albums_of_artist/:artist_ID(.:format) songs#get_albums_of_artist解决方法 删除锚点字符串中的#符号并在url helper方法中调用anchor:redirect_to comments_path(anchor:’anchor_tag’) 总结
以上是内存溢出为你收集整理的ruby-on-rails – Rails从Controller重定向到Anchor标签全部内容,希望文章能够帮你解决ruby-on-rails – Rails从Controller重定向到Anchor标签所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)