Hi,

Some questions came up to my mind when looking at your routes.

   - Do you really need a list action? Doesn't index action fill your needs?
   - Card seems to be another entitity. If It is true it would be better to
   use nested routes.

Using nested routes is easy:
resources :forms do
    resources :cards, only: [:show] # if you need just show action :)
end

Checkout the docs
<http://guides.rubyonrails.org/routing.html#nested-resources> for nested
resources and here
<http://guides.rubyonrails.org/routing.html#creating-paths-and-urls-from-objects>
you
can look for how to use link_to and nested routes :)

I'm sorry if I went in the wrong direction.

On Wed, Dec 10, 2014 at 6:13 PM, tom <[email protected]> wrote:

> hi
>
> i want to accomplish this:
> forms/:id
> forms/:id/list (action list)
>
> forms/:id/card/:x (action showcard)
>
>
>
>   resources :forms do
>       get  'list', :action => 'list' #<< ok
>       get 'card/:x' , :action=> 'showcard'  #, :as => 'card'      <<crash
> no method defined...
>
>   end
>
>
> and how would my link_to path look like? im going in circles. thx
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/CADQqhMc1BLAJShiTn8Lziv6WsATm6R2jUZ8ivrhRnq3uS8VdKA%40mail.gmail.com
> <https://groups.google.com/d/msgid/rubyonrails-talk/CADQqhMc1BLAJShiTn8Lziv6WsATm6R2jUZ8ivrhRnq3uS8VdKA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAA2Dq%2BOZB97f%2BLcEK3xMZMj%3DxUiY7HiPqYUO4C2cOM0XbzRuOg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to