Created
September 30, 2011 17:19
-
-
Save s6577t/1254399 to your computer and use it in GitHub Desktop.
Using blobject in a controller
This file contains hidden or 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
| class MyController < ApplicationController | |
| def params | |
| @blobject_params ||= Blobject.new(super) | |
| end | |
| def create | |
| model = find_model | |
| data = params.user_data | |
| if params.has_password? | |
| log("UPDATED: " + data.email) | |
| model.update_attributes(data) | |
| respond_with model | |
| end | |
| redirect_to 'http://rickroller.com' | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment