Rails, welcome to 2011. Fyi: string concatenation is bad
This commit is contained in:
parent
d66fc9d99f
commit
7b864dd208
2 changed files with 5 additions and 2 deletions
|
|
@ -79,7 +79,10 @@ class StatusMessagesController < ApplicationController
|
|||
photos.update_all(:status_message_guid => nil)
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js { render :json =>{:errors => @status_message.errors.full_messages}, :status => 422 }
|
||||
format.js {
|
||||
errors = @status_message.errors.full_messages.collect { |msg| msg.gsub(/^Text/, "") }
|
||||
render :json =>{:errors => errors}, :status => 422
|
||||
}
|
||||
format.html {redirect_to :back}
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ class StatusMessage < Post
|
|||
acts_as_taggable_on :tags
|
||||
extract_tags_from :raw_message
|
||||
|
||||
validates_length_of :text, :maximum => 10000, :too_long => I18n.t('status_messages.too_long', :count => 10000)
|
||||
validates_length_of :text, :maximum => 10000, :message => I18n.t('status_messages.too_long', :count => 10000)
|
||||
xml_name :status_message
|
||||
xml_attr :raw_message
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue