eRuby (Embedded Ruby) is a templating system that embeds Ruby into a text document. It is often used to embed Ruby code in an HTML document, similar to ASP, JSP and PHP.

learn more… | top users | synonyms

0
votes
0answers
16 views

Converting from a madlib program using hashmaps to using 3 different arrays to hold the noun, verb, and adjectives

Using erb and Sinatra, I need to make an array of each variable that can be added in, [noun], [verb] and [adjective], allowing me to return the number of each there are and create the appropriate ...
5
votes
3answers
194 views

Avoid printing attributes of the nil object in Rails

Currently, when I'm wanting to print a value for my class I do the following... <%= @person.team.name if @person.team.present? %> This seems really ...
1
vote
0answers
80 views

Using Middleman efficiently

My site is generated by Middleman. I know I could be using HAML, and Sass, and other optimizations are possible, but what I'm curious about at this stage is DRYing up code in my custom helpers, and ...
3
votes
1answer
85 views

Hide content unless an array contains at least one non-empty string

I have an array of hints. Sometimes, this array could contain an empty string. Occasionally, the array might contain only empty strings, in which case I want the whole block to be skipped. This is ...
6
votes
1answer
6k views

Best way to include image_tag inside link_to

What is the most elegant and readable way to in include (potentially long) image_tag calls inside of link_to? Example ...
6
votes
2answers
561 views

Showing items as in a Carousel

Is there a better way to implement my carousel in less lines? ...