I'm a newbie ruby on rails programmer, so forgive me if this is a stupid question... I'm wondering how to parse text after an html form submission. In short, I'm building a twitter rip-off as a personal project. I have an object called 'micropost' (basically a tweet) from which I want to extract hash tags. I have the following regular expression to do the parsing into an array:
micropost.text.gsub(/ (#\w+)/) { |a|
((a.include?('#'))) << a.strip.gsub(/#/, '')
}
however, I'm not quite sure where to place it? Should I put it in the data Model of micropost? In a micropost Helper? In the micropost Controller? Or in the html.erb View for the form.
Thanks so much for any help anyone can offer!