]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/user/account.html.erb
Use user_path links. Fixes #1785
[rails.git] / app / views / user / account.html.erb
index ab74e378079e2078dd602b079a1dbc421c6044f4..a493ade681a408fe3cae2aed5c9a74464c23e364 100644 (file)
@@ -5,13 +5,13 @@
 <% content_for :heading do %>
   <h1><%= t 'user.account.my settings' %></h1>
   <ul class='secondary-actions clearfix'>
-    <li><%= link_to t('user.account.return to profile'), :controller => 'user', :action => 'view', :display_name => current_user.display_name %></li>
+    <li><%= link_to t('user.account.return to profile'), user_path(current_user) %></li>
     <li><%= link_to t('user.view.oauth settings'), :controller => 'oauth_clients', :action => 'index' %></li>
   </ul>
 <% end %>
 
-<%= error_messages_for 'user' %>
-<%= form_for :user, :html => { :multipart => true, :id => 'accountForm', :class => 'standard-form', :autocomplete => :off } do |f| %>
+<%= error_messages_for current_user %>
+<%= form_for current_user, :url => { :action => :account }, :method => :post, :html => { :multipart => true, :id => 'accountForm', :class => 'standard-form', :autocomplete => :off } do |f| %>
   <fieldset>
     <div class="form-row">
       <label class="standard-label"><%= t 'user.new.display name' %></label>
@@ -92,7 +92,7 @@
   <fieldset class="form-divider">
     <div class='form-row'>
       <label class="standard-label"><%= t 'user.account.profile description' %></label>
-      <%= richtext_area :user, :description, :cols => 80, :rows => 20 %>
+      <%= richtext_area :user, :description, :object => current_user, :cols => 80, :rows => 20 %>
     </div>
 
     <div class="form-row">
                 <%= t 'user.account.replace image' %>
                 <span class="form-help deemphasize"><%= t 'user.account.image size hint' %></span>
             </label>
-            <%= f.file_field :image, :onchange => "$('#image_action_new').prop('checked', true)" %>
+            <%= f.file_field :image %>
           </li>
         <% else %>
         <li>
             <%= t 'user.account.new image' %>
             <span class="form-help deemphasize"><%= t 'user.account.image size hint' %></span>
           </label>
-          <%= f.file_field :image, :onchange => "$('#image_action_new').prop('checked', true)" %>
+          <%= f.file_field :image %>
         </li>
         <% end %>
         <li>