Help filling out a registration (I think it's called multi tenant)

Do you know when you are filling out a registration for a new account,
and
you keep pressing next to fill the rest of the information in separate
pages?

I’d like to do that, but I have no idea how.

Basically I have a company model with its information, and a contacts
model,
with belongs to my company (also each company has only one contact), and
I’d
like for the user to fill in the company specific information (like
email,
name, address, etc), and click next down the page to fill in the contact
information (telephone, manager email, etc). Also I’d like to save it to
the
database only if all the information in both pages are inputed.

Thank you,
Rodrigo

Hi Rodrigo,

Take a look at this screencast, from Ryan B.:

Best Regards,

Everaldo

And just FYI, multi-tenant usually means that you have one database
containing separate (unrelated) client accounts, for example Basecamp.
There isn’t a separate database for my Basecamp account and yours, our
records are all commingled in one set of tables, and the server
enforces business rules to make sure I don’t see your messages and
vice-versa.

Walter

thank you

I watched the screencast, and it covers the multi step form thing but
with only one model.
I’d like to the the same thing but each step would be a different
model. How can I do that?

Thank you very much, I’m watching the video right now, but I think this
is
exactly what I was looking for

Problem is I want more than one model as I explained before.

On Mon, Jul 11, 2011 at 4:15 PM, Rodrigo R. [email protected]
wrote:

I watched the screencast, and it covers the multi step form thing but
with only one model.
I’d like to the the same thing but each step would be a different
model. How can I do that?

1 page, 1 form, 1 model – sounds typical; what’s the problem?


Hassan S. ------------------------ [email protected]

twitter: @hassan

On Mon, Jul 11, 2011 at 5:55 PM, Rodrigo R. [email protected]
wrote:

Problem is I want more than one model as I explained before.

So each “step” is a different page, different model – again, what is
the issue? Complete one, go to the next.


Hassan S. ------------------------ [email protected]

twitter: @hassan

Take a look in these screencasts:

Maybe they can help you.

Best regards,

Everaldo

On Mon, Jul 11, 2011 at 10:11 PM, Hassan S. <

I want to save all together, not step by step. Or all saves, or none of
them
goes to the database

On Mon, Jul 11, 2011 at 10:11 PM, Hassan S. <

Hi All,

When I enter a Start Date in the text field as “07/11/2011” it gets
stored in the database as “2011-11-07” instead of “2011-07-11”.

This change happens before the column is available in the controller. Is
there some Rails setting that will make this happen magically or do I
have to have some fun with date parsing?

Thanks!

**Leigh


[_form.html.erb]
<%= f.label :start_date, :class => ‘label’ %>

<%= f.text_field :start_date, :size => 15 %>

[jobs_controller.rb]
def new
@job = Job.new
@job.rate = 125

respond_to do |format|
  format.html # new.html.erb
  format.json { render json: @job }
end

end

[schema.rb]
t.date “start_date”

It uses a method called ‘build’, which says (to me at least) that it
doesn’t
exist.

On Mon, Jul 11, 2011 at 10:15 PM, Everaldo G.

your input format is DD/MM/YYYY. change this to MM/DD/YYYY.

On 12 July 2011 02:15, Leigh D. [email protected] wrote:

Hi All,

When I enter a Start Date in the text field as “07/11/2011” it gets stored in
the database as “2011-11-07” instead of “2011-07-11”.

This change happens before the column is available in the controller. Is there
some Rails setting that will make this happen magically or do I have to have some
fun with date parsing?

If you want to allow the user to enter dates like this you will have
to parse it yourself to make sure the month and day are as you want
them. If the site is for an international audience I suggest you use
separate fields for the three components as otherwise you will have no
end of trouble as most of the world uses day/month/year. I don’t
understand what you mean by “it happens before the column is available
in the controller”. The field will be passed as a string from the
form to the controller and should appear in params exactly as entered
by the user. Note also that, since you have specified a date field in
the database, what is stored there is not “2011-07-11” or any other
string, but is the date itself.

Colin

On 12 July 2011 07:11, Sayuj O. [email protected] wrote:

On Tue, Jul 12, 2011 at 6:45 AM, Leigh D. [email protected]
wrote:

When I enter a Start Date in the text field as “07/11/2011” it gets stored
in the database as “2011-11-07” instead of “2011-07-11”.

your input format is DD/MM/YYYY. change this to MM/DD/YYYY.

Or better yet, “11 July 2011” - this makes it unambiguous. If you’re
expecting users to type in dates in a certain format without making
mistakes, you’re setting yourself up for lots of problems.

I’d also suggest using a date-select JS plugin to make it very easy
for your users to select the right date.

Do you mean the user should type it in as MM/DD/YYYY or that there is a
setting somewhere that I should change?

**Leigh

I don’t know if this is because Ryan B. used nifty-generators to
scaffold…

Try to follow the tutorial step by step, or download the source code of
the
episode.

Best Regards,

Everaldo

Hi Leigh,
It seems it takes the input as DD/MM/YYYY by default. that you need to
change to your convenient format.
Or
ask the user to input the date in DD/MM/YYYY format which is
default/current.

Actually what I’m looking for is a mix of the multistep form of 217
episode,
with a different (and related) model (like 192) for each step, and want
them
to be saved at same time.