-
Notifications
You must be signed in to change notification settings - Fork 232
Description
I am new to letsrate gem and also saw existing bugs. No one post the issue like this. In order to avoid ajax call, I am customized letsrate.js.erb for form submission. Setting the values of letsrate scores, dimensions and klass in hidden fields. Till now everything works fine for me.
In Review model:
letsrate_rateable "speed"
In letsrate.js.erb:
click: function(score, evt) {
var _this = this;
$("#business_rate_score").attr("value", score);
}
When am trying to use field_for and use those hidden fields like this:
<%= f.fields_for :rates do |g| %>
input type='hidden' id="business_rate_score" name="score"
input type='hidden' id="business_rate_dimension" name="dimension"
input type='hidden' id="business_rate_klass" name="klass"
<% end %>
For making nested_attributes in Review model:
letsrate_rateable "speed"
accepts_nested_attributes_for :rates, :allow_destroy => true
It throws No association found for name `rates'. Has it been defined yet? (ArgumentError)
Is letsrate gem accepting nested attributes? Can you explain me to make nested attributes to save the values?