Tim Shaffer wrote in post #955737:

>
> My apologies. I was not intending to be derogatory.

  I get frustrated after reading and researching routes in 4 different 
places books and websites and not understanding what they explaining. 
Then have some say " go read about  it"..like I was simpy trying to take 
a short cut. I'm probable hypersensitive

  I do much better in C#, but get tierd of it's criptic Database 
managment. But there are so many magic words in ruby that if I put it 
down for a month I forget the basic syntax....

> Supplying controller and action to the link_to method is one of the
> most fundamental things you can do in Rails. Instead of just giving
> you the answer (after giving you a hint how to find it), I was
> pointing you to the documentation so you may hopefully learn how to do
> what you wanted, and also learn how to use the documentation to
> quickly find answers to simple questions in the future.

  I new it was a simple question...and I knew what the problem was 
...but for the life of me the syntax wasn't coming... and  there was 
some thing fundametal I wasn't getting .. maybe it's take a break after 
4 hours or some thing lol

>> from the the index view if we hit the edit button it takes us to the
>> mechanizm to get from the show page to the print_label page using the
>> current :id as the scaffold built for getting from index to edit.
>
> When you specify "resources :tire" in routes.rb, it creates a default

  ok so thats all you put in routes.rb file?  "resource :tire" ?
  I can't seem to get my head around what the heck that would do... ruby 
magic makes my head hurt.... doing this creates the helper method so I 
can just go _path?

> set of named routes and the helper methods to go along with them.
> Again, this is basic rails functionality and is explained in-depth in
> the Routing guide:
>
> http://guides.rubyonrails.org/routing.html
>
>> So that link you gave me doesn't really explain how to make a route or
>> the sytax to use to call print_label and send it the current :id.
>
> If you scroll down to the third example under the link_to method, it
> clearly shows how to create a link using a controller, action, and id.
>
>   link_to "Profile", :controller => "profiles", :action => "show", :id
> => @profile
>
> So in your case, you could use the following syntax:
>
>   link_to "Print Label", :controller => "tires", :action =>
> "print_label", :id => @tire

   I am confused again ... when the scaffold built the link_to .. to the 
edit page it's syntax does not have the hashes... nor does it have 
:controller, :action, :id


>
> Although it's probably preferable to add another RESTful action. Then
> you would be able to use a print_label_tire_path helper like you have
> been trying to do. This again is explained in the Routing guide.
  Yes, I was trying the restful approach then every thing got into 
routes
  _path is a restful technique? always? To use path were would the 
restful action go ..in the model? or in the routes.rb?
> Best of luck.

 I get the the link_to now though...

-- 
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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to