Commit ade040c49e7fdf735779f6a8027ab470e9b7581f

Authored by AurelioAHeckert
1 parent 4edc9cf2

ActionItem152: tentando fazer um gerador de forms...

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1250 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/helpers/application_helper.rb
... ... @@ -7,6 +7,8 @@ module ApplicationHelper
7 7 include LightboxHelper
8 8  
9 9 include BoxesHelper
  10 +
  11 + include FormsHelper
10 12  
11 13 # Displays context help. You can pass the content of the help message as the
12 14 # first parameter or using template code inside a block passed to this
... ...
app/helpers/forms_helper.rb 0 → 100644
... ... @@ -0,0 +1,13 @@
  1 +module FormsHelper
  2 +
  3 + def generate_form( name, obj, fields={} )
  4 +
  5 + labelled_form_for name, obj do |f|
  6 +
  7 + f.text_field(:name)
  8 +
  9 + end
  10 +
  11 + end
  12 +
  13 +end
... ...
app/views/account/login.rhtml
... ... @@ -30,3 +30,5 @@
30 30 $('login').focus();
31 31 </script>
32 32 <% end %>
  33 +
  34 +<%# = generate_form :user, @user, {...} %>
... ...
app/views/profile_editor/person_info.rhtml
... ... @@ -14,3 +14,5 @@
14 14 <% end %>
15 15  
16 16 <% end %>
  17 +
  18 +<%# = generate_form :info, @info, {...} %>
... ...
public/stylesheets/controller_profile_editor.css 0 → 100644
... ... @@ -0,0 +1,4 @@
  1 +.profile_info th {
  2 + text-align: right;
  3 + padding-right: 20px;
  4 +}
... ...