erb
Sorting in Rails views without displaying duplicates
How do I sort in Rails view but without displaying any duplicate values? I have the following ERB code.[详细]
2023-02-16 04:52 分类:问答How to wrap content in html in a Rails helper
I want to wrap some content in HTML in a Rails 3 helper so that in my view I can do this: <%= rounded_box do-%>[详细]
2023-02-15 18:06 分类:问答VIM: insert empty ERB tags
How can I insert empty ERB tags and put cursor inside it? It is similar to surrounding with surround plugin, but there is nothing to surround.[详细]
2023-02-13 05:13 分类:问答Most appropriate way to generate directory of files from directory of template files with Rails and ERB?
My goal is to generate a directory of static html, javascript, and image files within my Rails (3) app, driven by ERB templates. For example, as a developer I might want to generate/update these files[详细]
2023-02-12 18:31 分类:问答Inserting javascript values into erb code
I have a js.erb template with the following code: var latlng = new google.maps.LatLng(<%= session[:lat] %>, <%= session[:lng] %>);[详细]
2023-02-12 08:31 分类:问答Error traces in Erubis
By default, when an an Erubis template raises an error, you get something like this: (erubis):32:in `evaluate\': compile error (SyntaxError)[详细]
2023-02-11 20:06 分类:问答question on ruby erb templates
I have this script for generating config files. I am using ruby and its builtin ERB. some of my templates consists of specific formats, spaces, braces etc[详细]
2023-02-10 02:00 分类:问答Single Ruby Value in One Line From a Collection
I have a collection of objects. There are 3 properties in each object \'id\', \'name\', \'is_primary\'[详细]
2023-02-09 21:44 分类:问答I can get correct data to display in my ERB, but I'm not following the standards. Can you help?
I have two models: user and transaction. Transactions table has user_id column for storing the id of the user responsible for transaction.[详细]
2023-02-08 15:15 分类:问答rails 3, erb (or haml), how can we restrict text input to 200 chars with nice user experience?
This SHOULD be trivially easy, but doesn\'t seem to be in Rails... we need to gather text input from the user of no more than 200 chars.[详细]
2023-02-08 10:14 分类:问答