Hi I have justed started using Rails. How do I create a contact page. By this I mean one with a contact form etc. Thanks -- Posted via http://www.ruby-forum.com/.
Andrew wrote:> Hi > > I have justed started using Rails. > > How do I create a contact page. By this I mean one with a contact form > etc. > > Thanks >Hi Andrew, create database table ''contact'' with fields you would like in your form, and run scaffold generator in your application directory: ruby script/generate scaffold Contact new it should be working: http://localhost:3000/contact/new After that you can customize view, model and controller to add obligatory fields, etc Bojan -- Bojan Mihelac Informatika Mihelac, Bojan Mihelac s.p. | www.informatikamihelac.com -> tools, scripts, tricks from our code lab: http://source.mihelac.org
I get "Couldn''t find ''scafford'' generator" I am typing this command from the root folder (the one which has the folders app, config, db,..... I have also typed the command in the app folder -- Posted via http://www.ruby-forum.com/.
Andrew Ye wrote:> I get > > "Couldn''t find ''scafford'' generator"Is that a typo? Should be "scaffold". -- Alex
Alex Young wrote:> Andrew Ye wrote: >> I get >> >> "Couldn''t find ''scafford'' generator" > Is that a typo? Should be "scaffold". >yes, it should be scaffold -- Bojan Mihelac Informatika Mihelac, Bojan Mihelac s.p. | www.informatikamihelac.com -> tools, scripts, tricks from our code lab: http://source.mihelac.org
Bojan Mihelac wrote:> Alex Young wrote: >> Andrew Ye wrote: >>> I get >>> >>> "Couldn''t find ''scafford'' generator" >> Is that a typo? Should be "scaffold". >> > yes, it should be scaffold > > -- > Bojan Mihelac > Informatika Mihelac, Bojan Mihelac s.p. | www.informatikamihelac.com > -> tools, scripts, tricks from our code lab: http://source.mihelac.orgOpp!! -- Posted via http://www.ruby-forum.com/.
Is there a step by step guide? The command now works :) It has now created the folder in the views folder called new. Isnt it http://localhost:3000/new/contact ??? I have no idea what to put in the rhtml file. What does the file in the new folder need to be called? Thanks -- Posted via http://www.ruby-forum.com/.
Andrew Ye wrote:> Is there a step by step guide?Try the tutorials listed here: http://rubyonrails.org/docs regards Justin
Bojan Mihelac wrote:> Andrew wrote: >> Hi >> >> I have justed started using Rails. >> >> How do I create a contact page. By this I mean one with a contact form >> etc. >> >> Thanks >> > > Hi Andrew, > create database table ''contact'' with fields you would like in your form, > and run scaffold generator in your application directory: > ruby script/generate scaffold Contact new > > it should be working: > http://localhost:3000/contact/new > > After that you can customize view, model and controller to add > obligatory fields, etc > > Bojan > > -- > Bojan Mihelac > Informatika Mihelac, Bojan Mihelac s.p. | www.informatikamihelac.com > -> tools, scripts, tricks from our code lab: http://source.mihelac.orgI have run the scaffold command and created the new table in the database called contact. the table has the fields i want e.g. id, name, email, comment I am lost at what i need to do next. Its so confusing Rails - try to get my head around where it stores everything, how its configured!! :( -- Posted via http://www.ruby-forum.com/.
> I am lost at what i need to do next. > > Its so confusing Rails - try to get my head around where it stores > everything, how its configured!! :(Try reading http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html. This provides the information you need. regards Claus
Is there a way to create a contact form that sends an email without having a table related to it. In my case I do not need a table contacts, I only need to send an email. thanks <h2>Contact Form</h2> <form action="contact.html"> <fieldset> <legend>Please send your message: </legend> <p><label>Your Name:<br /><input type="text" /></label></p> <p><label>Your email:<br /><input type="email" /></label></p> <p><label>Message:<br /><textarea rows="5" cols="5"></textarea></label></p> <p><label><input type="submit" value="Submit" class="submit" /></label></p> </fieldset> </form> -- 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 -~----------~----~----~----~------~----~------~--~---
Yes you can do it by using ActionMailer class On Oct 5, 8:10 pm, Pepe Sanchez <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Is there a way to create a contact form that sends an email without > having a table related to it. > > In my case I do not need a table contacts, I only need to send an email. > > thanks > <h2>Contact Form</h2> > <form action="contact.html"> > <fieldset> > <legend>Please send your message: </legend> > <p><label>Your Name:<br /><input type="text" /></label></p> > <p><label>Your email:<br /><input type="email" /></label></p> > <p><label>Message:<br /><textarea rows="5" > cols="5"></textarea></label></p> > <p><label><input type="submit" value="Submit" class="submit" > /></label></p> > </fieldset> > </form> > > -- > 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 -~----------~----~----~----~------~----~------~--~---