Home>
Why is it when I press the "Check operation" button with the following configuration?The action'show' could not be found for HogesController
I get the error, but I don't know how to deal with it.
- There is no show action on this controller in the first place
- The routing part
get'hoge2'
If i set it to, it will jump to the hoge2 action without error and get caught in pry - (Because the show action is not necessary this time) The routing part
resources: hoges, except: [: show] do
If i set it to, 404 will be returned. - The hoge2 action doesn't want to display the view, it's an action to handle within the action
# routes.rb
resources: hoges do
collection do
post'hoge2'
end
end
# hoges_controller.rb
def index;end
...
def hoge2
binding.pry
end
// index.html.haml
= link_to'Check operation', hoge2_hoges_path
If anyone knows the solution, please let me know.
-
Answer # 1
Related articles
- ruby on rails - about deploying apps using s3 function
- ruby on rails - [rails] i want to define routing using the resources method
- ruby - about rails routing
- ruby on rails 6 - about rails error "wrong number of arguments (given 1, expected 0)"
- ruby on rails - about saving comments
- ruby on rails - about image posting page argumenterror
- ruby on rails - i can't comment out using htmlerb begin
- ruby on rails - rails render: about the matter that the url after new is different
- ruby on rails - no data when using v-if
- ruby - [rails] about partial templates
- ruby on rails - about rails create action
- ruby on rails - about aws environment variables
- ruby - about the delete function in rails
- ruby on rails - about matters that cannot be migrated
- ruby - i want to get it at intervals by searching using rails active record
- ruby on rails - about primary key/natural key/surrogate key in db design
- ruby on rails - about the argument of rubyonrails params
- ruby on rails 5 - star evaluation using raty stars become very large
- ruby on rails - [rails] about the problem that screen transition is not possible (error does not occur)
Related questions
- ruby - passing variables using render partial
- ruby - deployment error on heroku
- ruby - output the total integer value held by each user
- ruby - i want to use the search method for active hash data
- ruby - destroy action does not respond
- ruby - how do you see the rails controller relative path? (carrierwave directory deleted)
- ruby - when deploying on capistrano, i get the error "access denied for user'ec2-user' @'localhost' (using password: no)&qu
- javascript - run multiple times with js + each do
- how to reflect the layout downloaded from the external site in ruby on rails?
- ruby - how nice! function routes do not pass well (relation) [rails]
The link you made normally
GET
Make a request at.post'hoge2'
Is not called.