Saturday, March 6, 2010

incrementing submissions, links, url validation

God, so much grunt work this past week. I think I've made some decent progress though.

1. incrementing submissions - Using form_tag to call a controller method, a preexisting url is incremented
2. Spent WAY too long trying to figure out the link/url showing up on the page properly. For some reason the View would keep adding things to the string I passed it (if it wasn't a "proper" url). After spending days trying to fix it, I decided it would just be easier (and possibly better practice) to validate URLs as they're submitted. Used a model validation.
3. See #2.

UPDATE:
Apparently, http: is a valid URL, as is http:/, http://, http://anything.
This is the info I used: http://mbleigh.com/2009/02/18/quick-tip-rails-url-validation.html

Perhaps there is a better way to do this.

No comments:

Post a Comment