在模态中设计编辑表单,而不是填充字段,除非它是从普通编辑视图渲染的

时间:2014-10-21 23:51:40

标签: ruby-on-rails ruby-on-rails-4 devise

我正在尝试让Devise用户能够从模态进行编辑。问题是,当模态加载时,它不会使用任何信息填充表单。但是如果我从/users/edit打开模态,表单就会填充。有谁知道如何解决这个问题?

_edit.html.haml

    .row
      .small-2.large-4.columns 
      .small-4.large-4.columns 
        %h2
          Edit #{resource_name.to_s.humanize}
        = form_for(resource, as: resource_name, url: registration_path(resource_name), html: { :multipart => true, method: :put }) do |f|
          = devise_error_messages!
          %div
            = f.label :email
            %br/
            = f.text_field :email
          %div
            = f.label :company_name
            %br/
            = f.text_field :company_name
          %div
            = f.label :branding
            %br/
            = f.file_field :branding
          %div= f.submit "Update"
        %h3 Cancel my account
        %p
          Unhappy? #{button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete}
        = link_to "Back", :back
      .small-6.large-4.columns 

它是从application/layout这样呈现的:

#editProfile.reveal-modal{"data-reveal" => ""}
    = render "devise/registrations/edit"
    %a.close-reveal-modal ×

0 个答案:

没有答案