hey all
i have a item and im trying to do a link that way:
link_to 'item',:action=>'show',:id=>@item+'#item'
but i get %23item instead of the #item.
any idea whats wrong?
thanx in advance
Pat
hey all
i have a item and im trying to do a link that way:
link_to 'item',:action=>'show',:id=>@item+'#item'
but i get %23item instead of the #item.
any idea whats wrong?
thanx in advance
Pat
Hi Patrick,
Patrick A. wrote:
link_to ‘item’,:action=>‘show’,:id=>@item+’#item’
but i get %23item instead of the #item
Coupla thoughts…
Rails may need you to use braces to parse that correctly.
e.g., link_to ‘item’, {:action=>‘show’,:id=>@item+’#item’}
Rails may have trouble with ‘#’ as part of a symbol.
What’s the full string you’re getting back in params[:id] ? That might
shed
some light.
hth,
Bill
One more clue…
The ascii hex value for ‘#’ is 23
thanx, i found it. anchor=> does the job
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs