best-in-place

best_in_place “:nil” function does not work in AJAX inserted partial

时光总嘲笑我的痴心妄想 提交于 2020-01-14 07:12:32
问题 I have a list of records on my page. I submit a form remotely via AJAX and the new record is appended to the list. All best_in_place features immediately work apart from the :nil option. This doesn't display the default value that I set. This makes it impossible to edit the value unless the user refreshes the page. Then the value is present and the user can click. Is this a known bug? Can anyone suggest a work around? Updated with my code: <%= best_in_place_if can?(:update, post), post, :post

show images in checkbox collection

霸气de小男生 提交于 2020-01-05 10:19:34
问题 I use best_in_place (it's not important for my question). I want to show images instead of the checkbox. my images are found in: public/images . so I tried: <%= best_in_place task, :done,:classes => 'highlight_on_success', type: :checkbox, collection: [image_tag("/images/checkbox_yes.gif"), image_tag("/images/checkbox_no.png")] %> unfortunately, the default image of the checkbox (should be the first image) is shown as - , and when I press it, I saw the second image. I tried to check if there

In-place editing with Rails, jquery and best_in_place gem

怎甘沉沦 提交于 2020-01-04 03:15:12
问题 I've got a task list app where tasks are displayed by category. I have the categories listed in two places. I'm allowing the category name to be edited in-place using the best_in_place gem. I have that working fine. My issue is that since I have the category name in two places and I'm only editing one occurrence of it in-place, I need the other appearance of the name that was not edited to be updated with the new name after the form submits. What would be the best way to refresh/reload the

In-place editing with Rails, jquery and best_in_place gem

帅比萌擦擦* 提交于 2020-01-04 03:14:08
问题 I've got a task list app where tasks are displayed by category. I have the categories listed in two places. I'm allowing the category name to be edited in-place using the best_in_place gem. I have that working fine. My issue is that since I have the category name in two places and I'm only editing one occurrence of it in-place, I need the other appearance of the name that was not edited to be updated with the new name after the form submits. What would be the best way to refresh/reload the

best_in_place gem, view not displaying updated edit without page reload

霸气de小男生 提交于 2019-12-25 08:49:49
问题 I added the best_in_place gem to my project and the update does NOT take effect until a page reload has happened. I can see it flash in my show view but it requires a page reload. Why is this? My Lists controller: respond_to :html, :xml, :js def update @list = List.find(params[:id]) @list.update_attributes(params[:list]) respond_with(@list, :location => list_url(@list)) end My Lists show view- <h2 class="page-header"><%= best_in_place @list, :name %></h2> <h2 class="lead"><%= best_in_place

best_in_place and html_safe

家住魔仙堡 提交于 2019-12-24 11:58:04
问题 I'm using the best_in_place gem in my rails app to allow for inline editing. I'm running into issues with trying to render some text html safe. Without specifying that the text should be made html_safe, this is what it looks like on the page: I looked at the best_in_place documentation and tried adding the following lines to render the text html safe: <div id="projectOverviewDescription"> <p> <%= best_in_place @project.overview, :description, :path => project_step_path(@project, @project

Datatables with best_in_place not allowing updating

 ̄綄美尐妖づ 提交于 2019-12-22 12:32:30
问题 I am attempting to use best_in_place with datatables to allow for updating of table entries in-line. However, I have everything rendering correctly and can edit the entry, the change does not persist and same to the database and throws the log below. At present I am just looking to edit the store id and address information: Started PUT "/locations/104" for 127.0.0.1 at 2015-05-02 16:15:17 -0400 Started PUT "/locations/104" for 127.0.0.1 at 2015-05-02 16:15:17 -0400 Processing by

Datatables with best_in_place not allowing updating

前提是你 提交于 2019-12-22 12:30:01
问题 I am attempting to use best_in_place with datatables to allow for updating of table entries in-line. However, I have everything rendering correctly and can edit the entry, the change does not persist and same to the database and throws the log below. At present I am just looking to edit the store id and address information: Started PUT "/locations/104" for 127.0.0.1 at 2015-05-02 16:15:17 -0400 Started PUT "/locations/104" for 127.0.0.1 at 2015-05-02 16:15:17 -0400 Processing by

Integration of WYSIWYG editor to best-in-place textarea

走远了吗. 提交于 2019-12-12 07:53:51
问题 I'm using best_in_place gem to editing client's info in-place. My question is, how can I integrate a WYSIWYG Editor for editing this content as HTML? I'm currently using this editor: https://github.com/Nerian/bootstrap-wysihtml5-rails/ I'm not good at javascript and cofeescript, so I'm probably doing something wrong. My code in view: <%= best_in_place @client, :info, :type => :textarea, :nil => "Click here to add content!", :html_attrs => { class: "wysihtml5" }, :sanitize => false %> And

Best in place building exotic method after creation

廉价感情. 提交于 2019-12-12 00:06:03
问题 I am attempting to use the best_in_place gem to allow inline editing to my data-tables. I have successfully added it to another, but adding it now creates an exotic path variable campaign_category_metro_bid_path when I add the final column of the table implementing best_in_place for some reason. Why is the error occurring? update_bidding.html.erb: <tbody> <% CampaignCategoryMetroBid.where(campaign_id: @campaign.id).each do |biddetail| %> <tr> <td><%= biddetail.id %></td> <td><%= biddetail