Skip to content

Instantly share code, notes, and snippets.

@meltzerj
Created March 30, 2011 21:42
Show Gist options
  • Save meltzerj/895374 to your computer and use it in GitHub Desktop.
Save meltzerj/895374 to your computer and use it in GitHub Desktop.
Here's the update action:
def update
@user = current_user
@profile = @user.profile
respond_to do |format|
if @profile.update_attributes(params[:profile])
format.html { redirect_to(@profile, :notice => 'Profile was successfully updated.') }
else
format.html { render :action => "edit" }
end
end
params[:genre]["name"].split(',').each do |genre_id|
self.genres << Genre.find(genre_id.to_i)
end
self.save!
end
Here's the edit action:
def edit
@user = current_user
@profile = @user.profile
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment