Created
November 11, 2009 18:15
-
-
Save plukevdh/232161 to your computer and use it in GitHub Desktop.
Allows confirmation page parameter passing to only pass changed values and lets us pull the values back out to the customer attributes.
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
# grabs the changed hash and maps it to a flat hash containing just the updated params | |
@customer.attributes = Hash[*(params[:customer].map{|k,v| [k, v.last]}.flatten)] |
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
# just pass the changed parameters to the controller. note, this page is form-less. | |
# simply passing parameters via 'get'. Not sure this is a good idea. | |
<%= link_to "Confirm Changes", {:action => "confirm", :customer => @customer.changes} %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment