In ruby we can make a line comments by using #. but when we use the same ruby code in .rhtml, how can i make comments a line <%= link_to ''Create New Book'', :controller => ''Book'', :action => ''list'' %> I want to comment this line in .rhtml file....how can i do that.... -- 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 -~----------~----~----~----~------~----~------~--~---
On Apr 28, 2008, at 3:01 PM, Manish Nautiyal wrote:> > In ruby we can make a line comments by using #. > but when we use the same ruby code in .rhtml, how can i make > comments a > line > > <%= link_to ''Create New Book'', :controller => ''Book'', :action => > ''list'' > %> > > I want to comment this line in .rhtml file....how can i do that....<%#= link_to ''Create New Book'', :controller => ''Book'', :action => ''list'' %> <%# this is an erb comment %> -Rob Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Rob Biedenharn wrote:> On Apr 28, 2008, at 3:01 PM, Manish Nautiyal wrote: > >> I want to comment this line in .rhtml file....how can i do that.... > <%#= link_to ''Create New Book'', :controller => ''Book'', :action => > ''list'' %> > <%# this is an erb comment %> > > > -Rob > > Rob Biedenharn http://agileconsultingllc.com > Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.orgThnx Rob.... There is one more error...................... i m new to ROR.......... i make a simple prog for login.......... Username and password....... if(right) { login } else { error msg } can u help me in this.......... -- 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 -~----------~----~----~----~------~----~------~--~---
On Apr 28, 2008, at 3:17 PM, Manish Nautiyal wrote:> Rob Biedenharn wrote: >> On Apr 28, 2008, at 3:01 PM, Manish Nautiyal wrote: >> >>> I want to comment this line in .rhtml file....how can i do that.... >> <%#= link_to ''Create New Book'', :controller => ''Book'', :action => >> ''list'' %> >> <%# this is an erb comment %> >> >> >> -Rob >> >> Rob Biedenharn http://agileconsultingllc.com >> Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org > > Thnx Rob.... > > There is one more error...................... > > i m new to ROR.......... > i make a simple prog for login.......... > Username and password....... > if(right) > { > login > } > else > { > error msg > } > > can u help me in this..........Well, that''s not really enough to go on. Take a look at the restful_authentication plugin or follow along with Agile Web Development with Rails for that kind of thing. -Rob Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
thanx ROB for u r advice........... but still i dnt knw how 2 use........if u hav any code for lgoin method thn pls paste it here.........i m getting prbolm of .......... NoMethodError my method is........... ------------------------------------------------------------------------- def login_submit if session[''user''] @logged_in = true else @logged_in = false end @user = User.new(@params[''user'']) if @session[''user''] = User.authenticate(@params[''user''][''username''], @params[''user''][''password'']) flash[:notice] = l(:user_login_succeeded) redirect_to :action => ''welcome'' else @login = @params[''user''][''login''] flash.now[:notice] = l(:user_login_failed) end end -------------------------------------------------------------------------- and in the rhtml file the form is.......... <% form_tag :controller => "user", :action => "login_submit" do %> <p class="input_fields"><label>Username: </label><input id="user_username" name="user[username]" size="15" type="text" /></p> <p class="input_fields"><label>Password: </label><input id="user_password" name="user[password]" size="15" type="password" /></p><br clear="all" /> <%= submit_tag "Login"%> <% end %> -------------------------------------------------------------------------- so can you help mee what is this prblm ............. -- 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 -~----------~----~----~----~------~----~------~--~---
On Apr 28, 2008, at 4:09 PM, Manish Nautiyal wrote:> thanx ROB for u r advice........... > > but still i dnt knw how 2 use........if u hav any code for lgoin > method > thn pls paste it here.........i m getting prbolm of .......... > NoMethodError > > my method is........... > ------------------------------------------------------------------------- > def login_submit > if session[''user''] > @logged_in = true > else > @logged_in = false > end > @user = User.new(@params[''user'']) > if @session[''user''] = User.authenticate(@params[''user''] > [''username''], > @params[''user''][''password'']) > flash[:notice] = l(:user_login_succeeded)Where is the l method defined? Is that where your NoMethodError comes from? Also, don''t user the @session or @params variables, use the session and params methods instead: if session[''user''] = User.authenticate(params[''user''][''username''], params[''user''][''password'']) -Rob> > redirect_to :action => ''welcome'' > else > @login = @params[''user''][''login''] > flash.now[:notice] = l(:user_login_failed) > end > end > -------------------------------------------------------------------------- > and in the rhtml file the form is.......... > > <% form_tag :controller => "user", :action => "login_submit" do %> > <p class="input_fields"><label>Username: </label><input > id="user_username" name="user[username]" size="15" type="text" /></p> > <p class="input_fields"><label>Password: </label><input > id="user_password" name="user[password]" size="15" type="password" > /></p><br clear="all" /> > > <%= submit_tag "Login"%> > <% end %> > -------------------------------------------------------------------------- > so can you help mee what is this prblm .............Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 remove all the things which you hav said......... but still the same prblm.........and this code is running fine in my office pc. but not working in my home pc. can u tell me wht the reason........?????????????? -- 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 -~----------~----~----~----~------~----~------~--~---