I''m studying at university and I have being asked to do an application
with ruby on rails that given a web page where you have to subscribe
introducing some information in a form, later, after registering, you
can see the data introduced and advising the user that he has been
correctly subscribe.
The problem is that I don''t know a lot about ruby on rails, I know I
must have my own data base but I have some questions. First of all, what
should I have in the controller and what for? Because I have put this:
class PrincipalController < ApplicationController
def form
render_text "Hola a todos"
end
def enviaDades
@subscriptor = @params[:subscriptor]
@addr = @params[:address]
@ciutat = @params[:ciutat]
@cpostal = @params[:cpostal]
@tcnum = @params[:tcnums]
@dcaduc = @params[:dcaduc]
@cc = @params[:cc]
redirect_to :action => ''form2''
end
end
end
Is that correct??
Which are the different data I have in my data base. Know the problem,
is that I don''t know what should I do next, to make the user see that
parameters and the advise telling him that all was correct. I have put
something like this, but i don''t know how to show the parameters.
<html>
<head>
<title> Subscripció Enwebats: Comformació
</title>
</head>
<body bgcolor=white>
<BR>
<h3> S''ha cursat la seva sol.licitud amb les dades:</h3>
<BR>
<BR>
<table border=0 width=50%>
<%print @subscriptor%>
<%print @addr%>
</table>
</body>
</html>
If it helps, here is the code of the web page where the form is:
<html>
<head>
<title> Subscripció Enwebats: Comformació
</title>
</head>
<body bgcolor=white>
<BR>
<FORM ACTION ="/EnWEBats/enviaDades" METHOD=POST>
Nom: <INPUT NAME="subscriptor" SIZE=57> <P>
Adreça: <INPUT NAME="address" SIZE=57> <P>
Ciutat: <INPUT NAME="ciutat" SIZE=32>
Codi Postal: <INPUT NAME="cpostal" SIZE=5> <P>
Núm. Tarjeta Crèdit: <INPUT NAME="tcnum"
SIZE=19>
Caduca: (MM/AA) <INPUT NAME="dcaduc" SIZE=5> <P>
AMEX <INPUT NAME="cc" TYPE=RADIO VALUE="amex"> VISA
<INPUT NAME="cc"
TYPE=RADIO VALUE="visa"> <P>
Tapes Enquadernables (+10 euros) <INPUT NAME="tapes"
TYPE=CHECKBOX><P>
<INPUT TYPE="submit" VALUE="Envia Dades">
</FORM>
</body>
</html>
Thanks.
--
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
-~----------~----~----~----~------~----~------~--~---