app/controllers/your_data_controller.rb
#
# Fills form fields with recent activity
# AJAX call
#

Fills form fields with recent activity
AJAX call
Fills form fields with recent activity AJAX call
def recent_activity_js
    recent_activity = @current_user.activities.find_recent
    unless recent_activity.nil?
      recent_comments = escape_javascript(recent_activity.comments)
      recent_time = hour_format(recent_activity.minutes)
    end
    render :update do |page|
      page['activity_comments'].value = recent_comments
      page['activity_minutes'].value = recent_time
    end
  end
def recent_activity_js recent_activity = @current_user . activities . find_recent unless recent_activity . nil? recent_comments = escape_javascript ( recent_activity . comments ) recent_time = hour_format ( recent_activity . minutes ) end render :update do | page | page [ 'activity_comments' ] . value = recent_comments page [ 'activity_minutes' ] . value = recent_time end end
Fills form fields with recent activity
AJAX call
Fills form fields with recent activity AJAX call