Module: SemanticId::Helper
- Defined in:
- lib/semantic_id/helper.rb
Instance Method Summary collapse
Instance Method Details
#semantic_id ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/semantic_id/helper.rb', line 6 def semantic_id string = String.new case when controller.action_name =~ /new|edit/ string += controller.action_name + "_" when controller.action_name =~ /index|create/ string += controller.controller_name else string += controller.controller_name.singularize end string += "_view" end |