HTML
Something you need to know is this is not a Rails
issue - it's an HTML
one. Although it is possible, it's more of a hack than a real customization
A good example is a demo we made here
(you'll have to register & click on the "profile" button at top right):

Customizing the file input
button isn't actually viable as you'd want - you basically need to hide the button & replace it with your own element, which can be then bound to a JS event.
--
Methods
Pavan posted an epic JSFiddle in the comments - props to him!!
We used jquery-file-upload
for our button - basically allows us to select the file & upload at the same time. Truly amazing:
#app/views/your_controller/view.html.erb
<div class="avatar">
<!-- New Avatar Upload Form -->
<%= form_for :upload, :html => {:multipart => true, :id => "avatar"}, :method => :put, url: profile_path(current_user.id), "data_id" => current_user.id do |f| %>
<div class="btn btn-success fileinput-button avatar" id="avatar_container">
<%= f.file_field :avatar, :title => "Upload New" %>
<%= image_tag(@user.profile.avatar.url, :width=> '100%', :id => "avatar_img", :alt => name?(@user)) %>
</div>
<% end %>
</div>
#app/assets/javascripts/application.js -> allows to upload directly (no submit)
$('#avatar').fileupload({
url: '/profile/' + $(this).attr('data_id'),
dataType: 'json',
type: 'post',
add: function (e, data) {
//$(".items .avatar .avatar").prepend('<div class="loading" id="avatar_loading"><img src="<%= asset_path("profile/avatar_loading.gif") %>"></div>');
//$('#avatar_loading').fadeIn('100');
$(this).avatar_loading('avatar_loading');
data.submit();
},
success: function (data, status) {;
$("#avatar_img").fadeOut('fast', function() {
$(this).attr("src", data.avatar_url).fadeIn('fast', function(){
$(this).avatar_loading('avatar_loading');
});
});
}
});