[Rails] Basics: How does Javascript communicate with Ruby on Rails?

2019-08-06 Thread Noel
Hello to All, I'm trying to understand something that I seem to get lost on, which is how exactly does Javascript communicate with Rails? I understand how to make it work, I can even make a React front-end and Rails API work together. But I feel like I am missing something fundamental when

[Rails] ActiveModel::Attributes (array: true) - should it require Postgres?

2019-08-06 Thread Patrick Davey
Hi, I'm really enjoying using the new ActiveModel::Attributes API for making form objects (replacing Virtus). At the moment, if you want to do : class Foo include ActiveModel::Model include ActiveModel::Attributes attribute :bars, :string, array: true you _must_ be using the

[Rails] Re: has_many through: Question

2019-08-06 Thread John Sanderbeck
I think I got it... I knew it had to be simple in Rails to do that... Just had to add * belongs_to :motd, class_name: 'Meal', foreign_key: :motd_id* has_and_belongs_to_many :meals has_and_belongs_to_many :mdrinks Now I have a Meal of the Day as well as Daily Meals John On Sunday,