| Module | MuraveyWebHelper |
| In: |
app/helpers/muravey_web_helper.rb
|
| Author: | Dmitry V. Sabanin <dmitry@sabanin.ru> |
| Copyright: | Copyright © 2005 MuraveyLabs, Ltd |
| URL: | muravey.net/opensource/ |
| Revision: | $Date: 2005/04/02 16:46:54 $ $Revision: 1.22 $ |
| License: | MIT |
This helper is a key part of MuraveyWeb API. You may want to add it to the controller where you want to render MW documents. This can be done via generic Rails helpers interface:
class ArticlesController < Application
helper :MuraveyWeb
end
After that, you can use helper methods in your views.
MuraveyWeb helper to work with content.
# Usage: mw :render => :image, :document => @image # or more link_to -like way: mw 'Want to know more?', :link => :text, :document => @document
You can :render following elements:
One of the following options is required:
You can build :link with following targets:
Possible options for :link are:
Examples:
mw "Click here", :link => :text, :document = @document # <a href="http://document-viewer-url/85" title="Document Title Here">Click here</a> mw "My photo", :link => :image, :document = @photo # <a href="http://document-viewer-url/85" title="My photo"> # <img src="http://document-viewer-url/85?limit_size=100" alt="Photo Title Here" /> # </a> # @article is an Article document that has link_to(document_symid) string somewhere # inside, with symid pointing at document with id 86 mw :render => :text, :document => @article # <p> Here is a link to a document: http://document-viewer-url/86 </p> # Paginator usage: mw :paginate => :folder, :folder => @news, :page => @params[:page] # This will render a paginator bar
# File app/helpers/muravey_web_helper.rb, line 90
90: def mw(*args)
91: parse_arguments(args).execute
92: end