Forum: Ruby on Rails Contact page

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A1d42c3fb1332b20edc162f98c7317bf?d=identicon&s=25 Andrew (Guest)
on 2006-03-23 15:54
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
866edcb271e88be4bfd935eea7947730?d=identicon&s=25 Bojan Mihelac (Guest)
on 2006-03-23 16:01
(Received via mailing list)
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
3cfbc66965d498e3deddf4f55a2cd929?d=identicon&s=25 Andrew Ye (asy1mpo)
on 2006-03-23 16:10
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
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (Guest)
on 2006-03-23 16:21
(Received via mailing list)
Andrew Ye wrote:
> I get
>
> "Couldn't find 'scafford' generator"
Is that a typo?  Should be "scaffold".
866edcb271e88be4bfd935eea7947730?d=identicon&s=25 Bojan Mihelac (Guest)
on 2006-03-23 16:29
(Received via mailing list)
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
3cfbc66965d498e3deddf4f55a2cd929?d=identicon&s=25 Andrew Ye (asy1mpo)
on 2006-03-23 16:35
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.org


Opp!!
3cfbc66965d498e3deddf4f55a2cd929?d=identicon&s=25 Andrew Ye (asy1mpo)
on 2006-03-23 16:46
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
Eea7ad39737b0dbf3de38874e0a6c7d8?d=identicon&s=25 Justin Forder (Guest)
on 2006-03-24 01:07
(Received via mailing list)
Andrew Ye wrote:
> Is there a step by step guide?

Try the tutorials listed here:

   http://rubyonrails.org/docs

regards

   Justin
3cfbc66965d498e3deddf4f55a2cd929?d=identicon&s=25 Andrew Ye (asy1mpo)
on 2006-03-24 13:10
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.org

I 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!! :(
B8d11b4c89cfc6e34d6c9fb121c9acac?d=identicon&s=25 Claus Guttesen (Guest)
on 2006-03-24 13:26
(Received via mailing list)
> 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
4287232616a1dde31cd2dab154acad70?d=identicon&s=25 Pepe Sanchez (jsn1)
on 2008-10-06 02:10
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>
Febcde7f09d486161ab6b3180c8b85c7?d=identicon&s=25 Gourav Tiwari (Guest)
on 2008-10-06 05:15
(Received via mailing list)
Yes you can do it by using ActionMailer class


On Oct 5, 8:10 pm, Pepe Sanchez <rails-mailing-l...@andreas-s.net>
This topic is locked and can not be replied to.