Created
March 30, 2011 21:42
-
-
Save meltzerj/895374 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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