Permalink
Browse files

DRY refactoring in search form

  • Loading branch information...
1 parent 6013c15 commit 9d5e54626aac1380ec470cb8777e92bcc5af6426 Liborio Cannici committed May 15, 2010
@@ -8,12 +8,7 @@
<% end %>
<div class="search">
- <% form_tag "/tolk/search", :method => :get do %>
- <%= hidden_field_tag :locale, @locale.name %>
- Search for an English phrase:
- <%= text_field_tag :q, params[:q] %>
- <%= submit_tag "Search", :name => nil %>
- <% end %>
+ <%= render :partial => "tolk/searches/form", :locals => { :locale => @locale } %>
</div>
<div class="translations">
@@ -13,12 +13,7 @@
<% end %>
<div class="search">
- <% form_tag "/tolk/search", :method => :get do %>
- <%= hidden_field_tag :locale, @locale.name %>
- Search for an English phrase:
- <%= text_field_tag :q, params[:q] %>
- <%= submit_tag "Search", :name => nil %>
- <% end %>
+ <%= render :partial => "tolk/searches/form", :locals => { :locale => @locale } %>
</div>
<div class="translations">
@@ -0,0 +1,6 @@
+<% form_tag "/tolk/search", :method => :get do %>
+ <%= hidden_field_tag :locale, locale.name %>
+ Search for an English phrase:
+ <%= text_field_tag :q, params[:q] %>
+ <%= submit_tag "Search", :name => nil %>
+<% end %>
@@ -3,12 +3,7 @@
<% end %>
<h3 class="search">
- <% form_tag "/tolk/search", :method => :get do %>
- <%= hidden_field_tag :locale, @locale.name %>
- Search for an English phrase:
- <%= text_field_tag :q, params[:q] %>
- <%= submit_tag "Search", :name => nil %>
- <% end %>
+ <%= render :partial => "form", :locals => { :locale => @locale } %>
</h3>
<div class="search_exits">

0 comments on commit 9d5e546

Please sign in to comment.