I currently have this action to create an object.
def create
@campaign = Campaign.create(params[:campaign])
respond_with(@campaign)
end
Since I’m using rails3-jquery-autocomplete to create an autocomplete for users to type in the username, I’m receiving the username as string and I’ll need it to convert to id to save it as user_id:integer.
I’m not sure how to run code before the create action is triggered.
You might want to use
before_filtermethod, provided by Rails.