On 23 September 2014 06:13, Diego Dillenburg Bueno
<diegodillenb...@gmail.com> wrote:
> Thank you very much for the attention, guys!
> I think I have nailed the association modelling. And as of the debt
> relationship. It would be like: Someone pay for a bill(creditor) for many
> other people(those are debtors), that's why I need to have 0, 1 or multiple
> debtors in one billing. That's where I keep track of who owes me(creditor)
> money for that billing.
>
> Now I've dived into a far more hairy problem:
>
> I'm trying to dinamically generate nested forms(so I can input how many
> debtors I want at the billing creation)
> I got it to work once, but now I don't know what I might possibly have
> changed so it's not working anymore.
> Tried rbates railscast, then his gem nested_form, then cocoon and couldn't
> get none of them to work properly anymore.
> I tracked down the problem to be basically that: whenever I click the link
> to add fields it's not triggering the creation of the new object, e.g. a
> Billing is created on action New but it's not creating the further
> billing.debts that I need to store the multiple debtors I input in the
> forms.

First look in development.log and check that the correct action is
being invoked and that the params are correct.  Then you have to debug
your code.  There are more sophisticated debug methods, but for a
start you can then put debug statements in the action to find out what
is going wrong. You can use logger.info to print stuff to the server
window to follow what is going on.  For example
logger.info "At some interesting point in the code"
and
logger.info someobject.inspect

Then you should be able to work out where it is going wrong.

Having said that I assume that you have already worked right through a
good tutorial such as railstutorial.org (which is free to use online).
If not then go and do that first, it will save you time in the long
run.

Colin

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLt4xgaBZNv05ZeHFyxKUmLNA%2BzqRcU22KqodnoeyHCrtQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to