Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic class for row #24

Open
noctivityinc opened this issue Feb 13, 2012 · 1 comment
Open

Dynamic class for row #24

noctivityinc opened this issue Feb 13, 2012 · 1 comment

Comments

@noctivityinc
Copy link

Im trying to pass the value of the variable as the class for the row. For example:

= table_for(@fonts) do |t|
= t.data :actions => :all, :action_prefix => "admin" do
    = t.cell :name, :cell_html => {:class => ??}
    = t.cell :family

As I am displaying a list of fonts and need the class for each font to be the value of the name of that font.

Any thoughts?

@jgdavey
Copy link
Owner

jgdavey commented Feb 14, 2012

That would require a bit of refactoring from what the code looks like now, as it would require the cell_html attribute to be saved off as a proc and re-evaluated for each member of the collection. In this case, I'd probably recommend using plain old HAML and helpers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants