Why is my custom route being ignored?

hunterp

I have a controller called banana.rb

In routes.rb I have:

 resources :banana, :path => "ban_fruit" do
    get 'list'
  end

And in the browser, I hit http://host.com/ban_fruit/list.json

But it errors, telling me: "The action 'show' could not be found for BananaController"

I need http://host.com/ban_fruit/list.json to work, how can I do this without renaming my controller?

Talgat Medetbekov

Try out like following:

get 'ban_fruit/list' =>  'banana#list'
#
# ban_fruit_list GET /ban_fruit/list(.:format)    banana#list

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Why is my ZF2 Segment child route being ignored?

From Dev

Why is my for loop being ignored?

From Dev

Why is my ServicePointManager.ServerCertificateValidationCallback being ignored?

From Dev

why is my cd %myVar% being ignored?

From Dev

Why is my Scalacheck/Scalatest PropertyCheckConfig being ignored?

From Dev

Why is my default browser setting being ignored?

From Dev

Why is my if else statement being ignored

From Dev

Why is my systemd link file being ignored?

From Dev

Why is my readline / .inputrc configuration being ignored?

From Dev

Why is my route not being hit?

From Dev

Why is my precondition being ignored on my Property-based test?

From Dev

Why is the if statement being ignored?

From Dev

Why are my Mongoose 3.8.7 schema getters and setters being ignored?

From Dev

why are the conditions in my if statement being ignored? C#

From Dev

Why is my Azure WebJobs "settings.job" file being ignored?

From Dev

Why is my Git ours merge strategy being ignored?

From Dev

why are the conditions in my if statement being ignored? C#

From Dev

Why is my template variable being ignored in ruby on rails?

From Dev

Why is my required external file being ignored in React Native?

From Dev

my 2nd if statement is being ignored dont know why

From Dev

Custom AlertDialog size being ignored

From Dev

My onclick event is being ignored

From Dev

The If statement is being ignored in my javascript

From Dev

Why is StringFormat being ignored in this Xaml?

From Dev

Why is my .setfocus ignored?

From Dev

Why is my nested if ignored?

From Dev

Why does my route insist on being GET, when it ~should~ be PUT

From Dev

Why does my route insist on being GET, when it ~should~ be PUT

From Dev

Why my custom font is not being applied to all my application?

Related Related

  1. 1

    Why is my ZF2 Segment child route being ignored?

  2. 2

    Why is my for loop being ignored?

  3. 3

    Why is my ServicePointManager.ServerCertificateValidationCallback being ignored?

  4. 4

    why is my cd %myVar% being ignored?

  5. 5

    Why is my Scalacheck/Scalatest PropertyCheckConfig being ignored?

  6. 6

    Why is my default browser setting being ignored?

  7. 7

    Why is my if else statement being ignored

  8. 8

    Why is my systemd link file being ignored?

  9. 9

    Why is my readline / .inputrc configuration being ignored?

  10. 10

    Why is my route not being hit?

  11. 11

    Why is my precondition being ignored on my Property-based test?

  12. 12

    Why is the if statement being ignored?

  13. 13

    Why are my Mongoose 3.8.7 schema getters and setters being ignored?

  14. 14

    why are the conditions in my if statement being ignored? C#

  15. 15

    Why is my Azure WebJobs "settings.job" file being ignored?

  16. 16

    Why is my Git ours merge strategy being ignored?

  17. 17

    why are the conditions in my if statement being ignored? C#

  18. 18

    Why is my template variable being ignored in ruby on rails?

  19. 19

    Why is my required external file being ignored in React Native?

  20. 20

    my 2nd if statement is being ignored dont know why

  21. 21

    Custom AlertDialog size being ignored

  22. 22

    My onclick event is being ignored

  23. 23

    The If statement is being ignored in my javascript

  24. 24

    Why is StringFormat being ignored in this Xaml?

  25. 25

    Why is my .setfocus ignored?

  26. 26

    Why is my nested if ignored?

  27. 27

    Why does my route insist on being GET, when it ~should~ be PUT

  28. 28

    Why does my route insist on being GET, when it ~should~ be PUT

  29. 29

    Why my custom font is not being applied to all my application?

HotTag

Archive