Last active
December 30, 2015 03:09
-
-
Save tochman/7767365 to your computer and use it in GitHub Desktop.
Fields for Avatar upload using carrierwave
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
<div class="collapse" id="register"> | |
<%= form_for(resource, :class => "collapse", :html => { :id => "registerForm", :multipart => true }, :as => resource_name, :url => registration_path(resource_name)) do |f| %> | |
<%= devise_error_messages! %> | |
<!--[if lt IE 9]> | |
<label for="user_password">Enter email</label> | |
<![endif]--> | |
<%= f.email_field :email, :autofocus => true, :id => 'signup_email', :name => 'user[email]', :placeholder => "you@example.com" %> | |
<!--[if lt IE 9]> | |
<label for="user_password">Enter password</label> | |
<![endif]--> | |
<%= f.password_field :password, :id => 'signup_password', :name => 'user[password]', :placeholder => "password" %> | |
<!--[if lt IE 9]> | |
<label for="user_password">Confirm password</label> | |
<![endif]--> | |
<%= f.password_field :password_confirmation, :id => 'signup_password_confirmation', :placeholder => 'confirm password' %> | |
<!--[if lt IE 9]> | |
<label>My Avatar</label> | |
<![endif]--> | |
<%= f.file_field :avatar, :placeholder => 'your avatar' %> | |
<%= f.hidden_field :avatar_cache %> | |
<div><%= f.submit "Sign up", :id => 'signup', :class => "btn btn-primary" %></div> | |
<% end %> | |
</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
<section id="devise"> | |
<h2>Sign up</h2> | |
<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :input_html => {:multipart => true}) do |f| %> | |
<%= f.error_notification %> | |
<div class="form-inputs"> | |
<%= f.input :email, :required => true, :autofocus => true %> | |
<%= f.input :password, :required => true %> | |
<%= f.input :password_confirmation, :required => true %> | |
<% if @user.avatar.url.present? %> | |
<%= image_tag(@user.avatar_url.to_s) %> | |
<% end %> | |
<%= f.file_field :avatar, :placeholder => 'your avatar' %> | |
<%= f.hidden_field :avatar_cache %> | |
</div> | |
<div class="form-actions"> | |
<%= f.button :submit, "Sign up" %> | |
</div> | |
<% end %> | |
<%= render "devise/shared/links" %> | |
</section> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/carrierwaveuploader/carrierwave