Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

named_scope -> scope and <% -> <%=

  • Loading branch information...
commit ff920096860a3729129ba4bc86f8ae52689592ba 1 parent c69d728
@lifo lifo authored
View
4 app/models/tolk/translation.rb
@@ -2,9 +2,7 @@ module Tolk
class Translation < ActiveRecord::Base
set_table_name "tolk_translations"
- named_scope :containing_text, lambda { |query|
- { :conditions => ["tolk_translations.text LIKE ?", "%#{query}%"] }
- }
+ scope :containing_text, lambda {|query| where("tolk_translations.text LIKE ?", "%#{query}%") }
serialize :text
validates_presence_of :text, :if => proc {|r| r.primary.blank? && !r.explicit_nil }
View
2  app/views/tolk/locales/index.html.erb
@@ -19,7 +19,7 @@
<p>No locales yet.</p>
<% end %>
-<% form_for(Tolk::Locale.new) do |f| %>
+<%= form_for(Tolk::Locale.new) do |f| %>
<div class="submit">
<%= f.error_messages %>
<p>
View
2  app/views/tolk/searches/_form.html.erb
@@ -1,4 +1,4 @@
-<% form_tag "/tolk/search", :method => :get do %>
+<%= form_tag "/tolk/search", :method => :get do %>
<%= hidden_field_tag :locale, locale.name %>
Search for
<%= scope_selector_for(@locale) %>
Please sign in to comment.
Something went wrong with that request. Please try again.