Hello, I’m setting up the grape gem within an existing Rails 4.2 CRUD app. It’s working well for GET requests, but it returns TypeError (compared with non class/module) when attempting a POST request with curl: https://gist.github.com/ornerymoose/cfc9237680eeef13356ff57529162995 . Something I’m overlooking with my POST code?
hello. I’m trying to do a standard has_many/belongs_to with a third model instead of just Model A and Model B. Reason being is that the two models with data are read from SQL Server and can’t have any joins/associations happening there. Here’s a gist of the setup: https://gist.github.com/ornerymoose/abb43dad682535d8a1a558475896abbf . When I try and fire this up in Rails console I’m getting: Could not find the source association(s) "chil
or :children in model Relationship. What am I overlooking here? (a child can never belong to more than one outage at a time)
Hello. I’m trying to understand how to update a relationship instead of creating a new one when updating an outage with children. Or maybe I’m overlooking something in my custom validation method in the relationship model: https://gist.github.com/ornerymoose/863d6b0ccd1e036792d9af229b6be7c8 Any insight is appreciated
NL3limin4t0r: correct, what would be a decent way to attack this situation? As I mentioned in the gist, I can update an outage with children that do not have a current association, or can remove existing children from that outage. but if a child belongs to a different outage, then that’s where the validation issue comes into play (ie, trying to update an outage with a child that is already associated to a different outage)
‘If I understand correctly you want to update the Child association to Outage with a new one’ correct, so it’d be updating the Relationship. so an example would be having a Relationship entry of outage_id: 1 and child_id:2, and changing the outage_id to 2
I’m using Nokogiri to parse a Rails view. If i remove some rows in the browser via jquery, they aren’t reflected in the generated CSV. Why is that? Do I need to use something like Mechanize? https://gist.github.com/ornerymoose/8e828ad525757ead1b8016d173689441
elomatreb: gotcha, thanks. Would Mechanize be a decent approach or do you have any suggestions?