uses the debate title length in the debates form
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
require 'numeric'
|
||||
class Debate < ActiveRecord::Base
|
||||
|
||||
TITLE_LENGTH = Debate.columns.find{|c| c.name == 'title'}.limit
|
||||
|
||||
acts_as_votable
|
||||
acts_as_commentable
|
||||
acts_as_taggable
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<p><strong><%= t("debates.form.debate_title") %></strong></p>
|
||||
<p><%= t("debates.form.title_instructions") %></p>
|
||||
<%= f.text_field :title %>
|
||||
<%= f.text_field :title, maxlength: Debate::TITLE_LENGTH %>
|
||||
|
||||
<br/>
|
||||
<p><strong><%= t("debates.form.debate_text") %></strong></p>
|
||||
|
||||
Reference in New Issue
Block a user