Created
August 25, 2016 18:07
-
-
Save hernandezalek/2e18183767255c697c96ff5e2477ebbb 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
$('#modal1').append('<%= j render "form" %>').openModal(); |
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
<!-- Modal Structure --> | |
<div class="modal-content grey-text"> | |
<h4 class="center black-text"><b>Editar perfil</b></h4> | |
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, multipart: true }, remote: true, authenticity_token: true ) do |f| %> | |
<%= devise_error_messages! %> | |
<div class="input-field col s12 m12 l12"> | |
<%= f.text_field :name, autofocus: true, placeholder: 'Nombre de la empresa' %> | |
</div> | |
<div class="input-field col s12 m12 l12"> | |
<%= f.email_field :email, placeholder: 'Correo electronico' %> | |
</div> | |
<div class="input-field col s12 m12 l12"> | |
<%= f.text_field :phone, placeholder: 'Numero telefonico' %> | |
</div> | |
<div class="input-field col s12 l12"> | |
<%= f.collection_select :municipality_id, Municipality.all, :id, :name, { :include_blank => "Seleccione" } , { class: 'browser-default' } %> <br> | |
</div> | |
<div class="input-field col s12 m12 l12"> | |
<%= f.password_field :password, autocomplete: "off", placeholder: 'Cambiar contraseña' %> | |
</div> | |
<div class="input-field col s12 m12 l12"> | |
<%= f.password_field :password_confirmation, placeholder: 'Confirmar contraseña' %> | |
</div> | |
<div class="input-field col s12 m12 l12"> | |
<div class="file-field"> | |
<div class="btn teal accent-5"> | |
<span>IMG</span> | |
<%= f.file_field :picture %> | |
</div> | |
<div class="file-path-wrapper"> | |
<input class="file-path validate" type="text" placeholder="Agregar imagen"> | |
</div> | |
</div> | |
</div> | |
<div class="input-field col s12 m12 l12"> | |
<%= f.text_area :about, class: 'materialize-textarea', placeholder: 'Acerca de la empresa' %> | |
</div> | |
<div class="input-field col s12 m12 l12"> | |
<%= f.password_field :current_password, autocomplete: "off", required: true, placeholder: 'Contraseña actual [ Campo requerido ]' %> | |
</div> | |
<div class="row"> | |
<div class="input-field col s12 m12 l12 center"> | |
<%= f.submit "Actualizar perfil", class: 'btn teal accent-5' %> | |
</div> | |
</div> | |
<% end %> | |
<hr><br> | |
<%= link_to 'Eliminar cuenta', registration_path(resource_name), data: { confirm: "¿Estas seguro que deseas eliminar esta empresa?" }, method: :delete, class: 'btn red lighten-2 white-text left' %> | |
</div> | |
<div class="modal-footer"> | |
<a href="#!" class="modal-action modal-close waves-effect waves-green btn blue lighten-2 white-text">Cancelar</a> | |
</div> |
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
<%= link_to edit_enterprise_registration_path, remote: true do %> | |
<%= current_enterprise.name %><i class="material-icons left">person</i> | |
<% end %> |
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
<% if @enterprise.resource_name.devise_error_messages! %> | |
Materialize.toast('Ocurrio un error!', 4000) | |
<% else %> | |
Materialize.toast('Se creo correctamente!', 4000); | |
$('#modal1').closeModal(); | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment