I am trying to use link_to and use this code, but getting the error in the title: <code> <%= link_to (vehicle_path(@vehicle), :method => :delete, {:confirm => "Are you sure?", :title => "Borrar #{@vehicle.plate}"}) do %> <%= image_tag "/assets/icons_big/delete.png" %> <span>Delete</span> <% end %> </code> I have tried without the brackets without luck and have not found any example that works for this. I have even tried: <code> <%= link_to (vehicle_path(@vehicle), :method => :delete) do %> <%= image_tag "/assets/icons_big/delete.png" %> <span>Delete</span> <% end %> </code> Again without luck, any help is appreciated. PS. for clarification, using this works <code> <%= link_to (vehicle_path(@vehicle)) do %> <%= image_tag "/assets/icons_big/delete.png" %> <span>Delete</span> <% end %> </code> or using this works too <code> <%= link_to "Delete", @vehicle, :method => :delete, :confirm => "Are you sure?", :title => "Delete #{@vehicle.plate}" %> </code> thanks again. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
I think you are missing the closing parentheses. you have <%= link_to (vehicle_path(@vehicle) it should be <%= link_to (vehicle_path(@vehicle)) On Monday, October 8, 2012 11:44:11 AM UTC-4, Ruby-Forum.com User wrote:> > I am trying to use link_to and use this code, but getting the error in > the title: > > <code> > <%= link_to (vehicle_path(@vehicle), :method => :delete, {:confirm => > "Are you sure?", :title => "Borrar #{@vehicle.plate}"}) do %> > <%= image_tag "/assets/icons_big/delete.png" %> > <span>Delete</span> > <% end %> > </code> > > I have tried without the brackets without luck and have not found any > example that works for this. > > I have even tried: > > <code> > <%= link_to (vehicle_path(@vehicle), :method => :delete) do %> > <%= image_tag "/assets/icons_big/delete.png" %> > <span>Delete</span> > <% end %> > </code> > > Again without luck, any help is appreciated. > > > PS. for clarification, using this works > <code> > <%= link_to (vehicle_path(@vehicle)) do %> > <%= image_tag "/assets/icons_big/delete.png" %> > <span>Delete</span> > <% end %> > </code> > or using this works too > <code> > <%= link_to "Delete", @vehicle, :method => :delete, :confirm => "Are you > sure?", :title => "Delete #{@vehicle.plate}" %> > </code> > > thanks again. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/nMDNQeca6_kJ. For more options, visit https://groups.google.com/groups/opt_out.
Lacides M.
2012-Oct-08 18:55 UTC
Re: syntax error, unexpected keyword_ensure, expecting $end
Nope, parenthesis are OK, but I have managed to make it right, the correct syntax is this <code> <%= link_to vehicle_path(@vehicle), {:method => :delete, :confirm => "Are you sure?", :title => "Borrar #{@vehicle.plate}"} do %> <%= image_tag "/assets/icons_big/delete.png" %> <span>Delete</span> <% end %> </code> without the parenthesis at all and the brackets surrounding html_options or it doesn´t work. thanks for all. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.