Open ingithub opened 11 years ago
How can I access to value? I need assign it to name:
%a{href: '#', class: "editable_#{post.id}", 'data-url' => post_path(post)}= post.name
:javascript
$(".editable_#{post.id}").editable({
type: 'text',
title: 'Enter username',
params: {
post: {
post_translations_attributes:{
id: "#{post.translation.id}",
name: 'This value'
}
}
}
});
Thank you for using! I update the repo to enable to overwrite params yesterday. (not released yet)
With a head of the repo, how about this:
gem 'bootstrap-editable-rails', github: 'tkawa/bootstrap-editable-rails'
<% @member.posts.each_with_index do |post, i| %>
<a href="#" class="post_body" data-type="text" data-resource="member[posts_attributes][<%= i %>]" data-id="<%= post.id %>" data-name="body" data-url="/members/1" data-original-title="Enter body">body</a>
<% end %>
$(".post_body").editable({
params: function(params) { // for ovewrite params
params[$(this).data('resource') + '[id]'] = $(this).data('id');
return params;
}
});
I'm going to think of a better spec for nested attributes.
tkawa - I don't understand the status of this issue. Are we supposed to be able to use the above code to fix the issue of editable columns in tables? It doesn't fix it for me.
I used the code above. I now get a popup for every row. I can change the data. But, the record doesn't get changed in the database.
Hi! Was there ever a feature added that allowed for editing nested attributes? It's working great for everything but my nested attributes. :-/
Hi,
this gem is working great and nice tutorial how to implement it, but how can I update nested attributes?
Thanks