Syntax error, unexpected keyword_ensure, expecting $end

I am trying to use link_to and use this code, but getting the error in
the title:

<%= link_to (vehicle_path(@vehicle), :method => :delete, {:confirm => "Are you sure?", :title => "Borrar #{@vehicle.plate}"}) do %> <%= image_tag "/assets/icons_big/delete.png" %> Delete <% end %>

I have tried without the brackets without luck and have not found any
example that works for this.

I have even tried:

<%= link_to (vehicle_path(@vehicle), :method => :delete) do %> <%= image_tag "/assets/icons_big/delete.png" %> Delete <% end %>

Again without luck, any help is appreciated.

PS. for clarification, using this works

<%= link_to (vehicle_path(@vehicle)) do %>
<%= image_tag “/assets/icons_big/delete.png” %>
<% end %>

or using this works too

<%= link_to “Delete”, @vehicle, :method => :delete, :confirm => “Are you
sure?”, :title => “Delete #{@vehicle.plate}” %>

thanks again.

I think you are missing the closing parentheses.
you have
<%= link_to (vehicle_path(@vehicle)

it should be
<%= link_to (vehicle_path(@vehicle))

Nope, parenthesis are OK, but I have managed to make it right, the
correct syntax is this

<%= link_to vehicle_path(@vehicle), {:method => :delete, :confirm => "Are you sure?", :title => "Borrar #{@vehicle.plate}"} do %> <%= image_tag "/assets/icons_big/delete.png" %> Delete <% end %>

without the parenthesis at all and the brackets surrounding html_options
or it doesn´t work.

thanks for all.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs