Skip to content

Instantly share code, notes, and snippets.

@MichaelDrogalis
Created December 4, 2011 03:18
Show Gist options
  • Save MichaelDrogalis/1429024 to your computer and use it in GitHub Desktop.
Save MichaelDrogalis/1429024 to your computer and use it in GitHub Desktop.
Controller:
def show_week_ajax
@period = TrainingPeriod.new current_user.id, TrainingPeriod.parse_date(params[:startdate])
@writable = true
respond_to do |format|
format.js { render :action => "workout-slider", :layout => false }
end
end
workout-slider.js.erb:
$("#workout-week").append("<%= render 'show_workouts', :locals => { :period => @period, :writable => @writable } %>");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment