Skip to content

Instantly share code, notes, and snippets.

@coderforhire
Created February 8, 2012 01:03
Show Gist options
  • Save coderforhire/1763780 to your computer and use it in GitHub Desktop.
Save coderforhire/1763780 to your computer and use it in GitHub Desktop.
@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
@coderforhire
Copy link
Author

TypeError in EventsController#create

can't dup NilClass
Rails.root: /home/afresta/rails_projects/YoureCupid-Development

Application Trace | Framework Trace | Full Trace
app/controllers/events_controller.rb:47:in `create'
Request

Parameters:

{"event"=>{"name"=>"My Event 1"}}
Show session dump

Show env dump

Response

Headers:

None

@coderforhire
Copy link
Author

$.post("/events", { "event[name]": copiedEventObject.title, "event[start_at]": copiedEventObject.start },
function(data) {
alert("Start at: " + copiedEventObject.start + "Event: " + copiedEventObject.title);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment