view: remote_form_for: equals sign mandatory to print blocks and replace to form_for and use :remote => true and :as

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9571 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2012-04-29 02:43:42 +00:00
parent 49b28fca68
commit 4b2fc90431
3 changed files with 12 additions and 7 deletions

View File

@ -32,10 +32,12 @@
</form>
<% end %>
<% remote_form_for(:relation, @relation,
<%= form_for @relation, {
:as => :relation, :remote => true,
:url => {:controller => 'issue_relations', :action => 'create', :issue_id => @issue},
:method => :post,
:complete => "Form.Element.focus('relation_issue_to_id');",
:html => {:id => 'new-relation-form', :style => (@relation ? '' : 'display: none;')}) do |f| %>
:html => {:id => 'new-relation-form', :style => (@relation ? '' : 'display: none;')}
} do |f| %>
<%= render :partial => 'issue_relations/form', :locals => {:f => f}%>
<% end %>

View File

@ -18,9 +18,10 @@
<td class="<%= member.principal.class.name.downcase %>"><%= link_to_user member.principal %></td>
<td class="roles">
<span id="member-<%= member.id %>-roles"><%=h member.roles.sort.collect(&:to_s).join(', ') %></span>
<% remote_form_for(:membership, member, :url => membership_path(member),
<%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),
:method => :put,
:html => { :id => "member-#{member.id}-roles-form", :class => 'hol' }) do |f| %>
:html => { :id => "member-#{member.id}-roles-form", :class => 'hol' }}
) do |f| %>
<p><% roles.each do |role| %>
<label><%= check_box_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
:disabled => member.member_roles.detect {|mr| mr.role_id == role.id && !mr.inherited_from.nil?} %> <%=h role %></label><br />
@ -59,9 +60,11 @@
<div class="splitcontentright">
<% if roles.any? && principals.any? %>
<% remote_form_for(:membership, @member, :url => project_memberships_path(@project), :method => :post,
<%= form_for(@member, {:as => :membership, :remote => true,
:url => project_memberships_path(@project), :method => :post,
:loading => '$(\'member-add-submit\').disable();',
:complete => 'if($(\'member-add-submit\')) $(\'member-add-submit\').enable();') do |f| %>
:complete => 'if($(\'member-add-submit\')) $(\'member-add-submit\').enable();'
} ) do |f| %>
<fieldset><legend><%=l(:label_member_new)%></legend>
<p><%= label_tag "principal_search", l(:label_principal_search) %><%= text_field_tag 'principal_search', nil %></p>

View File

@ -24,7 +24,7 @@
</ul>
<% if manage_allowed %>
<% remote_form_for(:issue, @issue,
<%= form_for(@issue, :as => :issue, :remote => true,
:url => {:controller => 'repositories', :action => 'add_related_issue',
:id => @project, :repository_id => @repository.identifier_param,
:rev => @changeset.identifier},