Hi Pete,

On Thu, 2009-07-30 at 18:51 +0200, Pete Moran wrote:
> This is a total newbie question, so my apologies!

No need.  Welcome aboard!

> I am learning Ruby from the book Ruby for rails - the only issue is the
> examples seem to have been written in a earlier version of Ruby.

Very common issue.

> I appreciate that the end_form_tag has been depreciated, I tried
> replacing it with <% end %>
> 
> Which then gives
> 
> compile error
> /Users/pmoran/rails/r4music1/app/views/customer/_login.html.erb:9:
> syntax error, unexpected kENSURE, expecting $end

<% end %> is correct.  

I believe your problem is that if you're going to use
the :controller/:action syntax, you need to enclose them in {}. e.g.,

<%= form_tag {:controller => "customer", :action => "login"} %>

You'll want to learn to use Google as your first lines of defense ;-)
I recommend that whenever you get an error, you enter it into your
Google search bar preceded by the word 'rails'.

using the above as an example...  Google

rails syntax error, unexpected kENSURE, expecting $end

You'll also want to learn to read the rails documentation.  

api.rubyonrails.org

Focus first on the methods which are in the lower pane on the left.

> I can't see any examples on the documentation which also specify the
> controller, as I say I am a total Ruby newbie so please go easy on me
> here!

The easiest way to get a handle on some of this basic stuff is to use
the scaffold feature.  You'll get the full stack.  I recommend
generating a rails app named 'sandbox'.  Keep it around for working out
issues / problems later.

rails sandbox

rake db:create:all

ruby script/scaffold test_model field1:string field2:text field3:integer

The files generated will give you the basics of the current syntax.

HTH,
Bill


--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to