Skip to content

Commit

Permalink
notes on url helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
kristianmandrup committed Nov 22, 2012
1 parent 41f56ed commit b70e4d6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.rdoc
Expand Up @@ -132,6 +132,19 @@ A call to

will render the configured UnauthorizedUserCell instead of the original LoginCell if the login test fails.

Note: Not sure Cell Builders are supported in Apotomo widgets?

== URL helpers

Using the *_url helpers implies accessing the request instance, which kinda breaks encapsulation. Cells doesn’t support breaking things, that’s why you have to include it manually.

Include the UrlFor module into your widget.

class MyLinkingWidget < Apotomo::Widget
include ActionController::UrlFor

Inside a cell there should normally be no need to generate urls this way, since the cell should only render the views that relate directly to its actions. The url helpers would instead be used in the templates. Try to avoid "complex" redirection logic in your cells.

== Plug it in

You now tell your controller about the new widget.
Expand Down

0 comments on commit b70e4d6

Please sign in to comment.