Initial commit to the repo
[kwestie.git] / app / helpers / application_helper.rb
blob36276296bd68b8a45e9a8128ba6a9d6893b2d254
1 # Methods added to this helper will be available to all templates in the application.
2 module ApplicationHelper
3   def form_label(obj, meth, str)
4     '<label for="%s_%s">%s</label>' % [ obj, meth, str ]
5   end
7   def focus(field_name)
8     %{
9     <script type="text/javascript">
10     // <![CDATA[
11           Field.activate('#{field_name}');
12     // ]]>
13     </script>
14     }
15   end
17   def hCard(user)
18     %{
19     <span class="vcard">
20       #{link_to user.display_name, user_url(user), :class => "author url fn nickname"}
21     </span>
22     }
23   end
24 end