<% # Render as follows: # # render( # :partial => 'edit', # :locals => { # :poll => , # :action => :create | :update # } # ) # # ...where is the poll to edit and :action is used for the # internationalised text in the 'submit' action button. In addition, # a "delete" button is shown for the :update case. form_for( poll ) do | f | %> <%= f.error_messages %> <% if ( action == :update ) -%> <% end -%>
<%= f.label :title %> <%= f.text_field :title, :size => 30, :maxlength => Poll::MAXLEN_TITLE %>
<%= f.label :currency %> <% if ( poll.votes.blank? || poll.votes.zero? ) -%> <%= currencyhelp_menu( Currency.all, { :form => f } ) %> <% else -%> <%=h poll.currency.name %>
<%= apphelp_view_hint( :cannot_change_currency_hint ) %> <% end -%>
<%= f.label :target_for_sorting %> <%= currencyhelp_edit( poll.currency, f, :target, poll ) %>
<%= f.label :workflow_state %> <%= apphelp_state( poll.workflow_state, PollsController ) %> ⇒ <%= pollshelp_state_change_menu( f, poll ) %> <%= help_link( "poll_states" ) %>
<%= apphelp_view_hint( :state_change_care_hint ) %>

<%= f.label :description %> (modern Textile)

<%= apphelp_view_hint( :preview ) %>
<%= f.text_area :description, :rows => 20, :cols => 80, :class => 'redcloth_preview_source' %>

<%= apphelp_submit( f, action ) %> <% if ( action == :create ) -%> <%= apphelp_protected_button_to( :index, { :method => :polls_path } ) %> <% else -%> <%= apphelp_protected_buttons_to( nil, [ :show, { :method => :poll_path }, @poll ], [ :index, { :method => :polls_path } ] ) %> <% end -%>
<% end %>