Skip to content

Instantly share code, notes, and snippets.

def create
@event = Event.new(params[:event])
respond_to do |format|
if @event.save
format.html { redirect_to @event, notice: 'Event was successfully created.' }
format.json { render json: @event, status: :created, location: @event }
else
format.html { render action: "new" }
format.json { render json: @event.errors, status: :unprocessable_entity }
def create
@ticket = Ticket.new(params[:ticket])
@user = User.find(params[:user_id])
@ticket.save
NotifyMailer.notify_email(@user).deliver
flash[:notice] = "Thanks for submitting your ticket!"
redirect_to tickets_open_path
end
NoMethodError (undefined method `email' for nil:NilClass):
app/mailers/notify_mailer.rb:8:in `new_email'
app/controllers/tickets_controller.rb:58:in `create'
"activationdate":null,"branch_id":5,"connectiontype":null,"created_at":"2012-02-03T22:11:01Z","dns1":null,"dns2":null,"domain":"capone.mcallen.node1","gateway":"558.255.465456465","id":6,"ipaddress":"655.556565","macaddress":null,"netmask":"255.255.255.0","pcserial":null,"remoteaccess":null,"screen":null,"updated_at":"2012-02-03T22:13:26Z","videocard":null,"warrantyends":null}
div class="ec-calendar"style="width: 500px;"><table class="ec-calendar-header" cellpadding="0" cellspacing="0"><thead><tr><th colspan="2" class="ec-month-nav ec-previous-month"><< <a href="/calendar/2012/1">January</a></th><th colspan="3" class="ec-month-name">February 2012</th><th colspan="2" class="ec-month-nav ec-next-month"><a href="/calendar/2012/3">March</a> &gt;&gt;</th></tr></thead></table><div class="ec-body" style="height: 498px;"><table class="ec-day-names" style="height: 18px;" cellpadding="0" cellspacing="0"><tbody><tr><th class="ec-day-name" title="Sun">Sun</th><th class="ec-day-name" title="Mon">Mon</th><th class="ec-day-name" title="Tue">Tue</th><th class="ec-day-name" title="Wed">Wed</th><th class="ec-day-name" title="Thu">Thu</th><th class="ec-day-name" title="Fri">Fri</th><th class="ec-day-name" title="Sat">Sat</th></tr></tbody></table><div class="ec-rows" style="top: 18px; height: 480px;"><div class="ec-row" style="top: 0px; height: 96px;"><table class="ec-row-bg" cellpadding="0" cellspaci
<div class="ec-calendar"style="width: 500px;"><table class="ec-calendar-header" cellpadding="0" cellspacing="0"><thead><tr><th colspan="2" class="ec-month-nav ec-previous-month"><< <a href="/calendar/2012/1">January</a></th><th colspan="3" class="ec-month-name">February 2012</th><th colspan="2" class="ec-month-nav ec-next-month"><a href="/calendar/2012/3">March</a> &gt;&gt;</th></tr></thead></table><div class="ec-body" style="height: 498px;"><table class="ec-day-names" style="height: 18px;" cellpadding="0" cellspacing="0"><tbody><tr><th class="ec-day-name" title="Sun">Sun</th><th class="ec-day-name" title="Mon">Mon</th><th class="ec-day-name" title="Tue">Tue</th><th class="ec-day-name" title="Wed">Wed</th><th class="ec-day-name" title="Thu">Thu</th><th class="ec-day-name" title="Fri">Fri</th><th class="ec-day-name" title="Sat">Sat</th></tr></tbody></table><div class="ec-rows" style="top: 18px; height: 480px;"><div class="ec-row" style="top: 0px; height: 96px;"><table class="ec-row-bg" cellpadding="0" cellspac
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: true,
droppable: true, // this allows things to be dropped onto the calendar !!!
drop: function(date, allDay) { // this function is called when something is dropped
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
editable: true,
droppable: true, // this allows things to be dropped onto the calendar !!!
drop: function(date, allDay) { // this function is called when something is dropped
@event = Event.new(params[:event])
@event.user = current_user
@time = params[:event][
@event.start_at = DateTime.strptime(params[:event][:start_at], "%Y/%m/%d %H:%M:%S").to_time
<script type='text/javascript'>
$(document).ready(function() {
/* initialize the external events
-----------------------------------------------------------------*/