How could I accomplish this sort of thing with a single model? I want to create several records at once with an "Add Another Record" button, but I'm only using a single model, not nested...
I love Ryan's screencasts. I can't seem to get this working for me, however. The grouped_collection_select works, but my app seems to be ignoring the js.coffee file. I have the include tags in my application.html header, but still, no magic is happening. Does anyone know what I'm doing wrong?
Tried this, but no calendar shows up - I just get the Month Header with the FWD/BACK arrows to change the month. No data or even a blank calendar displays. There is data in my @schedules array.
I'm trying to implement this, but I'm stuck. I am carrying a param from a previous page to the index, and when I click on "Search" I get the error "Couldn't find Sla without an ID"... I know I'm doing something dumb, but can someone help me?
Seems to be ignoring scopes. When I want to view a scoped result set and apply a Ransack filter, it views the unscoped results...
def my_queue
@search = Ticket.open.where(:analyst_id => current_user.id).search(params[:q])
@tickets = @search.result.paginate(:page => params[:page], :per_page => 25)
render 'shared/tickets.html.erb'
end
Did you find help for this? I, too, would like to copy the record above to create a new record - like an Excel sheet...
How could I accomplish this sort of thing with a single model? I want to create several records at once with an "Add Another Record" button, but I'm only using a single model, not nested...
I would like to export the filtered results, as well. What are those few lines I'd need? Appreciate the help...
I love Ryan's screencasts. I can't seem to get this working for me, however. The grouped_collection_select works, but my app seems to be ignoring the js.coffee file. I have the include tags in my application.html header, but still, no magic is happening. Does anyone know what I'm doing wrong?
invoices.js.coffee :
jQuery ->
$('#invoice_facility_id').parent().hide()
facilities = $('#invoice_facility_id').html()
console.log(facilities)
$('#invoice_division_id').change ->
division = $('#invoice_division_id :selected').text()
options = $(facilitys).filter("optgroup[label=#{division}]").html()
console.log(options)
if options
$('#invoice_facility_id').html(options)
$('#invoice_facility_id').parent().show()
else
$('#invoice_facility_id').empty()
$('#invoice_facility_id').parent().hide()
_form.html.erb :
<label>Division:<font color="red">*</font></b></label>
<%= f.collection_select :division_id, Division.order(:division), :id, :division, :include_blank => true %>
<label>Facility:</label>
<%= f.grouped_collection_select :facility_id, Division.order(:division), :facilities, :division, :id, :facility, :include_blank => true %>
Tried this, but no calendar shows up - I just get the Month Header with the FWD/BACK arrows to change the month. No data or even a blank calendar displays. There is data in my @schedules array.
<div id="calendar">
<h2 id="month">
<%= link_to "<", :month => (@date.beginning_of_month-1).strftime("%Y-%m-%d") %>
<%=h @date.strftime("%B %Y") %>
<%= link_to ">", :month => (@date.end_of_month+1).strftime("%Y-%m-%d") %>
</h2>
<% calendar_for(@schedules) do |t| %>
<% t.head('mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun') %>
<% t.day (:day_method => :coursedate) do |day, schedules| %>
<%= day.day %>
<% schedules.each do |schedule| %>
<%= h(schedule.id) %>
<% end %>
<% end %>
<% end %>
</div>
I'm trying to implement this, but I'm stuck. I am carrying a param from a previous page to the index, and when I click on "Search" I get the error "Couldn't find Sla without an ID"... I know I'm doing something dumb, but can someone help me?
Controller:
And the view:
Thanks in advance for any help....