Skip to content

Instantly share code, notes, and snippets.

@creich
Created October 5, 2012 13:44
Show Gist options
  • Save creich/3839873 to your computer and use it in GitHub Desktop.
Save creich/3839873 to your computer and use it in GitHub Desktop.
def show_booking
@time_logs = TimeLog.where(:id => params[:time_log_ids]).all
respond_to do |format|
format.js
end
end
def show_booking
@time_logs = TimeLog.where(:id => params[:time_log_ids]).all
render :update do |page|
time_logs.each do |item|
@time_log = item
page.replace_html 'entry-'+item.id.to_s, :partial => 'time_logs/booking_form'
end
end
end
<% @time_logs.each do |item| %>
$('#<%= "entry-" + item.id.to_s %> ').html(' <%= escape_javascript(render(:partial => 'time_logs/booking_form', :locals => {:time_log => item})) %> ');
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment