HI all,

I have two problem so i thought i would put them together. First problem
is that i can not what out how to get <%= link_to 'Show', test %> into
a <a href=" here "></a> for the post i have selected. I have got to the
point where i have got <%= test %> would just displays
#<Job:0x007fcd15570168> in the address bar instead of i.e /tests/1 etc.

How can this be done?

Second problem is with the routes. I have routes generated form the
resources :tests when i run scaffold but the when i create a match to
something it keeps on saying "Couldn't find Job with id=whatever". I did
as follows:-

match 'tests/index' => 'tests#index' which comes back "Couldn't find
Job with id=index"
match "/tests/google" => redirect("http://www.google.co.uk") which
comes back "Couldn't find Job with id=google"

What i can understand is that i have a link /test/:id which is causing
the problem, but the thing i don't understand is that there is a link
/tests/new which works so whats stopping my matches working as these
links that was generated automatically are not in the routes.

Any help with these will be great

Thanks

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Paul Na at Apr 20, 2012 at 11:15 am
    Sorry the second problem i sorted. I noticed that it is priority bases
    so i put the matches above the resources: tests and it worked!.

    So the only issue is the first one now.


    Thanks

    --
    Posted via http://www.ruby-forum.com/.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
  • Paul Na at Apr 20, 2012 at 2:01 pm
    Don't worry i sorted it

    --
    Posted via http://www.ruby-forum.com/.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedApr 20, '12 at 10:59a
activeApr 20, '12 at 2:01p
posts3
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Paul Na: 3 posts

People

Translate

site design / logo © 2022 Grokbase