Hi,

On Fri, Oct 30, 2009 at 4:31 PM, Cs Webgrl <[email protected]
> wrote:

>
> Hi,
>
> In my application I've set up a custom route that works as long as I
> stay within the same model.  This makes me think that I must have
> something wrong with the route.
>
> map.agent ':agent', :controller => 'agents', :action => 'show'
> The resulting url is http://www.domain.com/firstname-lastname
>
> The problem that I have is creating a link_to from a view outside of
> agents.  I currently have this, but this will
>
> <%= link_to_unless(@property.agent.nil?, "view bio",
> @property.agent.permalink) %> generates this:
> http://www.domain.com/properties/firstname-lastname
>
>
Can't you do this? <%= link_to_unless(@property.agent.nil?, "view bio",
{agent_url, :name => @property.agent}) %> or whatever your name would
default to


> Any ideas how to get this all to work correctly?
>
> Thanks!
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>


-- 
www.abetaday.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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to