Hi I have created a page were users can make a rating for a product and add this to a database, but when they do this the correct way teh item name is moved to the rating page and used in a text box. I want to secure my program by stopping users from using this page if the try to go to it directly without going through a product screen. Below is what I was thing of: if (:item_name == "") then( error )else { <% form_for(@rating) do |f| %> <p> <b>Item name</b><br /> <%= f.text_field :item_name %> </p> <p> <b>Comment</b><br /> <%= f.text_area :comment %> </p> <p> <b>Seller rating</b><br /> <%= f.text_field :seller_rating %> </p> <p> <b>Advert rating</b><br /> <%= f.text_field :advert_rating %> </p> <p> <%= f.submit "Create" %> </p> <% end %> <%= link_to ''Back'', ratings_path %> ) i cannot get anything like this to work though. Here is the controller if it helps: def new @rating = Rating.new if params[:product_name] @rating.item_name = params[:product_name] end respond_to do |format| format.html # new.html.erb format.xml { render :xml => @rating } end end -- 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 29 Mar 2008, at 18:06, Alan Red wrote:> > Hi > > I have created a page were users can make a rating for a product and > add > this to a database, but when they do this the correct way teh item > name > is moved to the rating page and used in a text box. > > I want to secure my program by stopping users from using this page if > the try to go to it directly without going through a product screen. > > Below is what I was thing of: >If statements in erb files are fine: <% if some condition %> ... <% else %> ... <% end %>> if (:item_name == "") then( >I''m not sure why you wrote that but i''m guessing you meant @rating.item_name == '''' (or even @rating.item_name.blank? ) Fred --~--~---------~--~----~------------~-------~--~----~ 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 All, I got Registered for Google Domains.I got My own Domain on my name. Now i want to Host a demo Rails Application on to my Google Domain. 1 . Is it possible to Setup Rails applications onto Google Domains ? 2. If so, Please let me know where to place my Code and How to Setup My Application ? Waiting for Kind Reply ! Cheers, Rajesh --~--~---------~--~----~------------~-------~--~----~ 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 Rajeshwar! Welcome to the web development world. I''m sure it''s possible. Tell us, can you put html up on the site? Do they do dynamic content hosting? If you can tell us this, we can help you further :-) Julian. Learn about Ruby on Rails! CHECK OUT THE FREE VIDS (LIMITED TIME) http://sensei.zenunit.com/ On 30/03/2008, at 5:27 AM, Rajeshwar Mothe wrote:> Hi All, > > I got Registered for Google Domains.I got My own Domain on my name. > Now i want to Host a demo Rails Application on to my Google Domain. > > 1 . Is it possible to Setup Rails applications onto Google Domains ? > > 2. If so, Please let me know where to place my Code and How to Setup > My Application ? > > > Waiting for Kind Reply ! > > Cheers, > Rajesh > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---