Skip to content

Commit

Permalink
Added partial support for partial form
Browse files Browse the repository at this point in the history
  • Loading branch information
cykod committed Sep 24, 2010
1 parent 810608a commit 7e7a869
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/controllers/editor/auth_renderer.rb
Expand Up @@ -29,6 +29,13 @@ def user_register
@usr = EndUser.new
@address = @usr.build_address(:address_name => 'Default Address'.t, :country => @options.country )
@business = @usr.build_work_address(:address_name => 'Business Address'.t, :country => @options.country )
if request.post? && params[:user] && params[:partial]
@usr.attributes = params[:user].slice(*(@options.required_fields + @options.optional_fields + @options.always_required_fields).uniq)
@address.attributes = params[:address].slice( @options.available_address_field_list.keys) if params[:address]
@business.attributes = params[:business].slice( @options.available_address_field_list.keys) if params[:business]


end

if @options.publication
@model = @options.publication.content_model.content_model.new
Expand All @@ -41,7 +48,7 @@ def user_register

@captcha = WebivaCaptcha.new(self) if @options.require_captcha

if request.post? && params[:user] && !@registered
if request.post? && params[:user] && !@registered && !params[:partial]
# See we already have an unregistered user with this email
@usr = EndUser.find_target(params[:user][:email],:no_create => true)

Expand Down

0 comments on commit 7e7a869

Please sign in to comment.