I have this model:
class Story < ActiveRecord::Base
validates_presence_of :name , :link
end
Where a validation for a form take place. But I want also to validate if the string "http" is included in the :link symbol. I can't do :link.include? because :link is symbol. How do I do that?
My View is this:
<% form_for :story do |f| %>
<p>
name:<br />
<%=f.text_field :name %>
</p>
<p>
link:<br />
<%= f.text_field :link %>
</p>
<p>
<%= submit_tag :"submit this story" %>
</p>
<% end %>