I have a calendar that I'm trying to update via ajax: A user selects a
different month, clicks the submit button, and the calendar shows the
month they selected without reloading the whole page.
Now, my problem is that it is rendering the layout multiple times. I'm
getting cascading menus, images, etc.
Here's my controller code:
#get either current month or requested month
if not request.post?
@selected_date = Date.today
@year = Time.now.year
@month = Time.now.month
@selected_date = Date.new(params[:date][:year].to_i,
@year = Date.new(params[:date][:year].to_i, Time.now.month,
@month = Date.new(Time.now.year,params[:date][:month].to_i,
@sales_orders = SalesOrder.find(:all,
:conditions => ['month(ship_date) =
? and year(ship_date) = ?',@month,@year])
render :partial => 'calendar_header', :layout => 'standard'
you can render :layout => false
How can I render the layout only once, no matter how many times the user
changes the calendar month? I'm sure I'm missing something easy here.
does that help?