edit input value before saving in Rails -
hi have simple input field url user:
<%= f.text_field :url, :value=>"#{@url_website}" %>
i process input check if put http:// before it, , if not, add manually. run function on before saving? how done?
thanks!
well should put before_save
in model format text, if model this
before_save :format_url def format_url #put important here end
Comments
Post a Comment