Skip to content

Commit

Permalink
Challenge ui update
Browse files Browse the repository at this point in the history
  • Loading branch information
alemyis committed Mar 24, 2011
1 parent a3d0b1e commit 4446cd5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/controllers/challenges_controller.rb
Expand Up @@ -87,7 +87,7 @@ def update
format.html { redirect_to(@challenge, :notice => 'Challenge was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.html { redirect_to(@challenge, :error => 'Unsuccessful submission.') }
format.xml { render :xml => @challenge.errors, :status => :unprocessable_entity }
end
end
Expand Down
8 changes: 2 additions & 6 deletions app/views/challenges/_answer_fields.html.erb
@@ -1,7 +1,3 @@
<%= f.hidden_field :contact_id, :value => 1 %>
<%= f.input :response %>
<%= f.input :illustration, :hint => 'optional representative image url' %>
<% f.fields_for :contact do |f_contact| %>
<hr/><hr/>
<%= render 'contacts/contact', :f => f_contact %>
<% end %>
<%= f.input :response, :label => false, :input_html => { :maxlength => 200 } %>
<%#= f.input :illustration, :hint => 'optional representative image url' %>
10 changes: 5 additions & 5 deletions app/views/challenges/_categorization_fields.html.erb
@@ -1,10 +1,10 @@
<p>
<%= f.hidden_field :misale_id, :value => f.object.misale_id %>
<%= f.hidden_field :position, :value => f.object.position %>
<li>
<% f.fields_for :answers do |f_answer| %>
<% if f_answer.object.new_record? then %>
<%= f.object.misale.head %>
<%= render 'answer_fields', :f => f_answer %>
<%= render 'answer_fields', :f => f_answer, :head => f.object.misale.head %>
<% end %>
<% end %>
</p>
<%= f.hidden_field :misale_id, :value => f.object.misale_id %>
<%= f.hidden_field :position, :value => f.object.position %>
</li>

0 comments on commit 4446cd5

Please sign in to comment.