Commit 0e575f49339461b1b14806c6a2eafcaa0096a7d5
1 parent
412ffbaa
Exists in
master
and in
22 other branches
ActionItem6: Fixing links in views and validation in model of enterprise
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@213 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
5 changed files
with
10 additions
and
3 deletions
Show diff stats
app/controllers/enterprise_controller.rb
| ... | ... | @@ -14,6 +14,7 @@ class EnterpriseController < ApplicationController |
| 14 | 14 | |
| 15 | 15 | def register |
| 16 | 16 | @enterprise = Enterprise.new(params[:enterprise]) |
| 17 | + @enterprise.identifier = @enterprise.name | |
| 17 | 18 | if @enterprise.save |
| 18 | 19 | @enterprise.people << current_user.person |
| 19 | 20 | flash[:notice] = _('Enterprise was succesfully created') | ... | ... |
app/models/enterprise.rb
| 1 | 1 | #A enterprise is a kind of profile. According to the system concept, only enterprises can offer priducts/services |
| 2 | 2 | class Enterprise < Profile |
| 3 | 3 | |
| 4 | - validates_numericality_of :foundation_year, :only_integer => true | |
| 4 | + validates_numericality_of :foundation_year, :only_integer => true, :allow_nil => true | |
| 5 | + | |
| 5 | 6 | end | ... | ... |
app/views/enterprise/_enterprise.rhtml
app/views/enterprise/index.rhtml
app/views/enterprise/register_form.rhtml
| ... | ... | @@ -31,5 +31,5 @@ |
| 31 | 31 | <%= text_area 'enterprise', 'management_information', 'cols' => 40, 'rows' => 20 %></p> |
| 32 | 32 | |
| 33 | 33 | <p><%= submit_tag _('Register') %> |
| 34 | -<%= link_to _('Cancel'), :action => 'register' %></p> | |
| 34 | +<%= link_to _('Cancel'), :action => 'index' %></p> | |
| 35 | 35 | <% end %> | ... | ... |