ismail
ismail

Reputation: 3923

Ruby / ROR - Syntax Error Keyword END (All blocks have end)

Getting the following error:

syntax error, unexpected keyword_ensure, expecting keyword_end  

and

syntax error, unexpected $end, expecting keyword_end

with code

  <% if user.admin? do %>
        <%= form_tag({:controller => '/admin/link', :action=> 'link', :id => @link.id}) do %>

        <%= render :partial => "link_form" %>

        <% end %>
    <% end %>

Though i have been through the code about 10 times, all my blocks are closed. The answer may be very easy since i am a ruby/ror newbie. Also the code is not very difficult, only about 15 lines.

Upvotes: 0

Views: 151

Answers (1)

Duke Silver
Duke Silver

Reputation: 1629

Seems like you have an extra 'do'. First line should just be

<% if user.admin? %>

Upvotes: 7

Related Questions