A couple of months ago I made a gem to help with string interpolation in
Rails. If you ever find yourself needing to allow users to insert variables
into strings which they provide, this gem may be quite useful to you. You
basically define a list of variables which can be "inserted" on a model and
then allow users to insert them by entering something like
"{{user.first_name}}". You can also register and use various formatters to
allow the user to decide how they should appear (e.g.
"{{user.first_name.upcase}}").
I've love to hear any feedback and if anyone has any ideas of additional
things it would be useful it did.
https://adamcooke.io/string-interpolation-in-ruby/
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/0a72d906-e29a-4117-8150-52b1b090c471%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.