Contact page

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

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 M.
Informatika Mihelac, Bojan M. 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

Alex Y. wrote:

Andrew Ye wrote:

I get

“Couldn’t find ‘scafford’ generator”
Is that a typo? Should be “scaffold”.

yes, it should be scaffold


Bojan M.
Informatika Mihelac, Bojan M. s.p. | www.informatikamihelac.com
→ tools, scripts, tricks from our code lab: http://source.mihelac.org

Bojan M. wrote:

Alex Y. wrote:

Andrew Ye wrote:

I get

“Couldn’t find ‘scafford’ generator”
Is that a typo? Should be “scaffold”.

yes, it should be scaffold


Bojan M.
Informatika Mihelac, Bojan M. s.p. | www.informatikamihelac.com
→ tools, scripts, tricks from our code lab: http://source.mihelac.org

Opp!!

Andrew Ye wrote:

I get

“Couldn’t find ‘scafford’ generator”
Is that a typo? Should be “scaffold”.

Andrew Ye wrote:

Is there a step by step guide?

Try the tutorials listed here:

http://rubyonrails.org/docs

regards

Justin

Is there a step by step guide?

The command now works :slight_smile:

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

Bojan M. 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 M.
Informatika Mihelac, Bojan M. 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!! :frowning:

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!! :frowning:

Try reading Radar – O’Reilly.
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

Contact Form

Please send your message:

Your N.:

Your email:

Message:

Yes you can do it by using ActionMailer class

On Oct 5, 8:10 pm, Pepe S. [email protected]