jellybob / activo-rails

Activo is a theme for Web-app-theme, Formtastic and Attrtastic. This is a Rails plugin to make it painfully easy to use.
http://dmfrancisco.github.com/activo/
MIT License
42 stars 8 forks source link

Helper for content boxes #6

Closed tobsch closed 13 years ago

tobsch commented 13 years ago

Hey there!

Activo-rails is a pretty nice piece of software! We're starting to use it in production soon. Just one question:

Have you thought about abstracting the

stuff?

I could think of stuff like

<% content_box :headline => 'foobar' do |box| %> <% box.controls do |c| %> ... <% end %>

my content <% end %>

are you still doing something like that? seems pretty copy-intensive otherwise...

best,

tobi

tobsch commented 13 years ago

/cc @jellybob

The content_box helper is there. experimental in rails3_1 branch. any experiences with testing capture calls?

jellybob commented 13 years ago

I'm using Capybara in the specs at spec/integration/ to check that correct output appears on the page. I had originally been trying to test those methods individually but the tests would break all the time, seemingly with the only exceptions being when the helpers were actually not working.

There's a Rails app running Activo in spec/dummy/ which you can add new views to for testing.

jellybob commented 13 years ago

I've just written some tests for the content_box helper - I think I'm covering everything, but if you want to have a look they're in spec/helpers/content_box_spec.rb and spec/integration/content_boxes_spec.rb.

I also added support for :class and :id options to match the API on all the other helpers, and tidied up the documentation.