undefined local variable or method `end_of_tag'

45 views
Skip to first unread message

zenonn

unread,
Jun 17, 2008, 10:46:04 AM6/17/08
to Beginning Ruby on Rails E-Commerce
Hello

I am getting this error for this code: undefined local variable or
method `end_of_tag'

<%= form_tag :action => 'create' %>
<%= render :partial => 'form' %>
<%= submit_tag 'Create' %>
<%= end_of_tag %>

<%= link_to 'Back', :action =>'index' %>

is this helper not working in 2.1
thanks
chris


Jarkko Laine

unread,
Jun 18, 2008, 1:35:19 AM6/18/08
to railsec...@googlegroups.com
Hi Chris,

On 17.6.2008, at 17.46, zenonn wrote:

>
> Hello
>
> I am getting this error for this code: undefined local variable or
> method `end_of_tag'
>
> <%= form_tag :action => 'create' %>
> <%= render :partial => 'form' %>
> <%= submit_tag 'Create' %>
> <%= end_of_tag %>

I think you mean end_form_tag. Anyway, it's removed from Rails 2 in
favor of using the block for of form tag:

<% form_tag :action => "create" do |f| %>

...


<% end %>

I'd also recommend taking a look at form_for in the api docs: http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#M000920

Cheers,
//jarkko


>
>
> <%= link_to 'Back', :action =>'index' %>
>
> is this helper not working in 2.1
> thanks
> chris
>
>
>

> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google
> Groups "Beginning Ruby on Rails E-Commerce" group.
> To post to this group, send email to railsec...@googlegroups.com
> To unsubscribe from this group, send email to railsecommerc...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/railsecommerce?hl=en
> -~----------~----~----~----~------~----~------~--~---
>

--
Jarkko Laine
http://jlaine.net
http://dotherightthing.com
http://www.railsecommerce.com
http://odesign.fi

zenonn

unread,
Jun 23, 2008, 5:08:58 PM6/23/08
to Beginning Ruby on Rails E-Commerce
Thanks Jarkko

On Jun 18, 1:35 am, Jarkko Laine <jar...@jlaine.net> wrote:
> Hi Chris,
>
> On 17.6.2008, at 17.46, zenonn wrote:
>
>
>
> > Hello
>
> > I am getting this error for this code:  undefined local variable or
> > method `end_of_tag'
>
> > <%= form_tag :action => 'create' %>
> > <%= render :partial => 'form' %>
> > <%= submit_tag 'Create' %>
> > <%= end_of_tag %>
>
> I think you mean end_form_tag. Anyway, it's removed from Rails 2 in  
> favor of using the block for of form tag:
>
> <% form_tag :action => "create" do |f| %>
>
> ...
>
> <% end %>
>
> I'd also recommend taking a look at form_for in the api docs:http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html...
>
> Cheers,
> //jarkko
>
>
>
>
>
> > <%= link_to 'Back', :action =>'index' %>
>
> > is this helper not working in 2.1
> > thanks
> > chris
>
> > >
> --
> Jarkko Lainehttp://jlaine.nethttp://dotherightthing.comhttp://www.railsecommerce.comhttp://odesign.fi
>
>  smime.p7s
> 3KDownload
Reply all
Reply to author
Forward
0 new messages