Hi all, i''m a nuby on rails. I''m using patrick Lenz''s book to study rails. When creating the login page for th application i got a problem. given below is the code <% form_tag do %> <p> Please log in.</p> <p> <label>Username:</label> <%= text_field_tag ''login''%> </p> <p> <label>Password:</label> <%= password_field_tag ''password'' %> </p> <p><%= submit_tag ''login'' %></p> <% end_form %> But when browsing to the page I get the error Showing app/views/account/login.rhtml where line #13 raised: compile error D:/TECHNO~1/INSTAN~1/rails_apps/shovell/config/../app/views/account/login.rhtml:13: parse error, unexpected $, expecting kEND But when I change the code from <% end_form %> to <% end %> the page loads but no textboxes are shown. I tried checking my code and the format seems to be right as in the book, I also googled to check if anything is wrong, but couldn''t come up with a solution. So I believe someone from here can help me out. Thanks. Chris -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> <% form_tag do %> > <p> Please log in.</p> > <p> > <label>Username:</label> > <%= text_field_tag ''login''%> > </p> > <p> > <label>Password:</label> > <%= password_field_tag ''password'' %> > </p> > <p><%= submit_tag ''login'' %></p>> <% end_form %> -- Here is the error. Repleace "end_form" by "end"Regards. Nicolas Santa. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I''m Sorry, i''m restart the message. You syntaxis are right. So you must have another error. Check the installation of rails. Nicolás Santa. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks Nicolás, though, i''m not sure. it may be an issue with my rails version. The <% start_form_tag %> is working Chris -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
andrew.ohnstad-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jun-26 14:32 UTC
Re: Doubt on form_tag do
You aren''t passing an action for the form... <% form_tag ''/controller/action'' do %> Replace "/controller/action" with the actual controller and action that will process the form data. I don''t know why that would cause the text boxes not to show up, but it''s still something that needs to be fixed. Try it and see if that clears up the problem. On Jun 26, 7:57 am, Christy John <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Thanks Nicolás, > though, i''m not sure. it may be an issue with my rails version. The > <% start_form_tag %> is working > > Chris > > -- > Posted viahttp://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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
try putting an = sign within the <% .. %> ---> <%= ... %> to allow what is enclosed to be rendered out. There is some inconsistency between form tag functions which can throw me for a loop too. On Jun 26, 8:32 am, "andrew.ohns...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <andrew.ohns...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> You aren''t passing an action for the form... > > <% form_tag ''/controller/action'' do %> > > Replace "/controller/action" with the actual controller and action > that will process the form data. I don''t know why that would cause > the text boxes not to show up, but it''s still something that needs to > be fixed. Try it and see if that clears up the problem. > > On Jun 26, 7:57 am, Christy John <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > > > Thanks Nicolás, > > though, i''m not sure. it may be an issue with my rails version. The > > <% start_form_tag %> is working > > > Chris > > > -- > > Posted viahttp://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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
andrew.ohnstad-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> You aren''t passing an action for the form... > > <% form_tag ''/controller/action'' do %> > > Replace "/controller/action" with the actual controller and action > that will process the form data. I don''t know why that would cause > the text boxes not to show up, but it''s still something that needs to > be fixed. Try it and see if that clears up the problem. > > On Jun 26, 7:57 am, Christy John <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>Hi Andrew, It''s not helping. still getting a D:/TECHNO~1/INSTAN~1/rails_apps/shovell/app/controllers/account_controller.rb:15: parse error, unexpected $, expecting kEND Any way thanks for looking at the matter. Chris -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I think your problem is versions of rails. I found with the older version of rails that I was running I had similar problems. With Version 1.2 the accepted syntax is <%form_tag do%> blah blah <%end%> With older versions you may have more luck with: <%=form_tag %> blah blah <%= form_tag_end %> At least that is what I have scribbled in the margin of my AgileDevWithRails book. Not sure if the = is required though. Hope that helps George On Jun 27, 3:26 pm, Christy John <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> andrew.ohns...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: > > You aren''t passing an action for the form... > > > <% form_tag ''/controller/action'' do %> > > > Replace "/controller/action" with the actual controller and action > > that will process the form data. I don''t know why that would cause > > the text boxes not to show up, but it''s still something that needs to > > be fixed. Try it and see if that clears up the problem. > > > On Jun 26, 7:57 am, Christy John <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > Hi Andrew, > It''s not helping. still getting a > D:/TECHNO~1/INSTAN~1/rails_apps/shovell/app/controllers/account_controller.rb:15: > parse error, unexpected $, expecting kEND > > Any way thanks for looking at the matter. > Chris > > -- > Posted viahttp://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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks to all for the help. I rewrote the whole code and now it''s working. I changed my login.rhtml to <%= start_form_tag :action => ''login'' %> <p>Please log in.</p> <p> Username: <%= text_field :user, :login %> </p> <p> Password: <%= password_field :user, :password %> </p> <p><%= submit_tag ''login''%></p> <%= end_form_tag %> ------------------------------------ and my login method in the account controller to def login if request.post? @current_user = User.find(:first, :conditions => ["login = ? and password = ?", params[:user][:login],params[:user][:password]]) unless @current_user.nil? session[:user_id] = @current_user.id redirect_to :controller => ''story'' end end end and it''s working. So it must be domething with my rails version. Anyway thanks for the help. You all are a very helpful bunch Chris -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
andrew.ohnstad-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jun-27 14:51 UTC
Re: Doubt on form_tag do
Christy, Do be careful with this as start_form_tag and end_form_tag have been depreciated and will be removed from rails 2.0 So if you are currently using an older 1.x version of Rails without support for form_tag and then at some point you (or even worse the system admins, if you don''t own your own box) upgrade rails, suddenly your application may break. If none of the features/fixes in the current versions of Rails make any difference to you, you might want to consider freezing rails for your application. See http://www.paulsturgess.co.uk/articles/show/18-why-you-should-freeze-rails-on-a-shared-host-environment for more info on freezing rails. On Jun 27, 5:16 am, Christy John <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Thanks to all for the help. I rewrote the whole code and now it''s > working. > I changed my login.rhtml to > > <%= start_form_tag :action => ''login'' %> > <p>Please log in.</p> > <p> > Username: <%= text_field :user, :login %> > </p> > <p> > Password: <%= password_field :user, :password %> > </p> > <p><%= submit_tag ''login''%></p> > <%= end_form_tag %> > ------------------------------------ > > and my login method in the account controller to > > def login > if request.post? > @current_user = User.find(:first, :conditions => ["login = ? and > password = ?", > params[:user][:login],params[:user][:password]]) > unless @current_user.nil? > session[:user_id] = @current_user.id > redirect_to :controller => ''story'' > end > end > end > > and it''s working. So it must be domething with my rails version. > Anyway thanks for the help. You all are a very helpful bunch > Chris > > -- > Posted viahttp://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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, Please can you help me with the following: Looking for a Ruby on Rails Developer, Salary £30K-£60K, Leicester, City Centre Use the latest web technology Ruby on Rails. To develop professional web applications. Must have written previous Rail applications. Need the talents of a smart, experienced programmer. Need to be attentive to detail, a team-player and responsible. Require previous commercial experience with Ruby on Rails and dealing with Database Schema''s to Front End Applications. Involved with creative projects which are making them a big name in the gaming and video industries (sony and microsoft). Would you be interested or do you know anyone who would be interested as there are several positions available. I appreciate your help in this. Ferdouse Ara Technical Recruitment Consultant Precision Recruitment UK Ltd Tel +44 (0) 116 2545488 Fax +44 (0) 871 2778928 http://www.precisionrecruitment.co.uk -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
After noting that you replied to several different threads on the same group, I for one would not be interested in replying, and I suspect the same for others. One post only please, and do not reply to an unrelated topic. Use a new post for any future requests. Michael On Jun 27, 2007, at 8:00 AM, Ferdouse Ara wrote:> > Hi, > > Please can you help me with the following: > > Looking for a Ruby on Rails Developer, Salary £30K-£60K, Leicester, > City > Centre > > Use the latest web technology Ruby on Rails. > To develop professional web applications. > Must have written previous Rail applications. > Need the talents of a smart, experienced programmer. > Need to be attentive to detail, a team-player and responsible. > Require previous commercial experience with Ruby on Rails and dealing > with Database Schema''s to Front End Applications. > > Involved with creative projects which are making them a big name in > the > gaming and video industries (sony and microsoft). > > Would you be interested or do you know anyone who would be > interested as > there are several positions available. > > I appreciate your help in this. > > Ferdouse Ara > Technical Recruitment Consultant > > Precision Recruitment UK Ltd > Tel +44 (0) 116 2545488 > Fax +44 (0) 871 2778928 > http://www.precisionrecruitment.co.uk > > > > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk- > unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > For more options, visit this group at http://groups.google.com/ > group/rubyonrails-talk?hl=en > -~----------~----~----~----~------~----~------~--~--- >
Micheal, were you referring to me or someone else. If it was for me, I don''t remember in cross posting. Thsnks Chris Michael Latta wrote:> After noting that you replied to several different threads on the > same group, I for one would not be interested in replying, and I > suspect the same for others. One post only please, and do not reply > to an unrelated topic. Use a new post for any future requests. > > Michael-- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---