Contact page


#1

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


#2

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


#3

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


#4

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


#5

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


#6

Andrew Ye wrote:

I get

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


#7

Andrew Ye wrote:

Is there a step by step guide?

Try the tutorials listed here:

http://rubyonrails.org/docs

regards

Justin


#8

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


#9

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:


#10

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 http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html.
This provides the information you need.

regards
Claus


#11

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:


#12

Yes you can do it by using ActionMailer class

On Oct 5, 8:10 pm, Pepe S. removed_email_address@domain.invalid