#713: Actionize && Parameterize. Thoughts?

I’m looking for some thoughts (and +1’s!) on a patch (#713) that introduces two new Inflectors: Actionize and Parameterize.

http://rails.lighthouseapp.com/projects/8994/tickets/713-new-inflectors-actionize-and-parameterize

Actionize

Transforms a string in titleize() form to a string suitable for a action name

“Expense Report”.actionize # => “expense_report”

“My Totally Cool Action”.actionize # => “my_totally_cool_action”

@reports = [‘Expense Report’, ‘Employee Hours’]

@reports.each do |report_name|

link_to(report_name, “/reports/#{report_name.actionize}”)

end

=> "Expense Report

Employee Hours"

Parameterize

Replaces special characters in a string so that it may be used as part of a ‘pretty’ URL.

==== Examples

class Person

def to_param

“#{self.id}-#{self.name.parameterize}”

end

end

@person = Person.find(1)

=> #<Person id: 1, name: “Donald E. Knuth”>

<%= link_to(@person.name, person_path %>

=> Login

Thanks!

Matt Darby**, M.S.**

Rails | PHP | Linux | MySQL | IT

Email: matt@matt-darby.com

Skype: matt-darby

Web: http://blog.matt-darby.com