I am working on an application where one controller controls the create action of several models. I have a lot more code, but I'm not sure if this error is specific to code or a generic fix (like changing the HTTP request) that doesn't require me to post my entire set up.
I have a 'basketball' model that belongs_to 'activities' that is generated from the activities controller. Each activity has_one basketball model.
Then in the basketballs controller I have this.
def edit
@activity = Activity.find(params[:id])
@basketball = @activity.basketball
end
def update
@activity = Activity.find(params[:id])
@basketball = @activity.basketball
if @basketball.update_attributes(basketball_params)
flash[:notice] = "Activity has been updated."
redirect_to activities_path
else
flash[:notice] = "Activity has not been updated."
render 'edit'
end
end
However, when I click the update button, my page renders a blank page with all of the parameters in the url. Example:
http://0.0.0.0:8080/basketballs/10/edit?utf8=%E2%9C%93&_method=patch&authenticity_token=[token]&basketball
Does anyone know how to fix this?