I have a view (show) that display's an Article. The Article has several Author[s]. The Article and Author models look like this:
Article Model has_many author_articles has_many articles, through: :author_articles Author Model has_many author_articles has_many author, through: :author_articles AuthorArticle Model belongs_to article belongs_to author
The join table (AuthorArticle) contains an article, author id columns, and another column called position_id. The Position model is also a has_many through. It looks like this:
Position Model has_many author_articles has_many positions, through: :author_articles Author Model has_many author_articles has_many author, through: :author_articles AuthorArticle Model belongs_to article belongs_to author belongs_to position
Here's what I would like to do and I am not exactly sure how to implement it. I would like to click on the author's name from the article show view, open a modal (already done) and have a form (SimpleForm) where the user can select a position (first, second, third, etc...) and press submit. The order of the author is important. Yes, there can be several "first/lead" authors. The form post would update the join table (AuthorArticle) position_id column with the position selected. Authors are added when a new article is created or updated.
Does this make sense? Let me know if you need more context? Something doesn't feel right about this approach and I'm open to suggestions/feedback/ideas.
Let's say we have a Rails project operating on the domain https://hello.world.com. The way the organization's infrastructure is set up, https://hello.world.com gets proxied into a new URL called - https://my.companies.server.com/hello . When I start the server with Rails s -e production and navigate my browser to https://my.companies.server.com/hello, all the CSS, assets, JS is broken. After some research I changed this config:
config.action_controller.asset_host = 'http://hello.world.com' and the CSS, JS, and assets seem to be working again. Great. One thing that's certainly not right is the links / main navigation (routes). For example, when navigating to any page in the browser, for example, https://my.companies.server.com/about, I get a 404. Seems like there should be a "pass-through" when a request comes in it gets mapped it to https://hello.world/about? Does this make sense? I could use some assistance. What's the best approach here?
I would like to get everyone's take on what are is the best practice for storing DB usernames/passwords, API keys, Contstants, Etc... Should they be stored in config/environments/ then in test, development production accordingly? Some of these files do end up in verstion control. Thoughts?