Re: [Rails] Doubts on what association to choose

2014-09-21 Thread Timothy Mukaibo
Hi Diego, You're correct when you say you can add the logic for a has_many / belongs_to (which is a one to many relationship), but as far as I'm aware, you need a has_many :through for adding logic to a many-to-many relationship. Good luck with the internship! Timothy. On 22 September 2014 12:37

Re: [Rails] Doubts on what association to choose

2014-09-21 Thread Diego Dillenburg Bueno
Won't I be able to add the logic I need for debts using has_many belongs_to? Basically all that I would need is to gather which debts I(as the user) have and be able to(in future) toggle their 'paid/unpaid' status. Or would it be better to have a relationship table? via has_many through? As of the

Re: [Rails] Doubts on what association to choose

2014-09-21 Thread Timothy Mukaibo
Assuming a single creditor and multiple debtors for a single billing, you will need a one to one relationship for the creditor -> billing (belongs_to on the billing, as you have done), but a many to many relationship for debts -> users. Generally, it's better to implement the many-to-many as a has

[Rails] Re: Migration Trouble

2014-09-21 Thread Jan Yo
That was it! 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroup

[Rails] Setting the default form builder

2014-09-21 Thread grzegorz
Hi, I implemented a custom form builder called BootstrapFormBuilder. I wanted to use it as the default form builder. I did manage to do that but not without problems. I'd like you to help me understand why my initial approach didn't work. I put my class in app/helpers/bootstrap_form_builder.rb