Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add number of patients to countries

  • Loading branch information...
commit 061d37ca04991c93052bf6ee4ec291609f692846 1 parent 07fed8f
ZuevEvgenii authored
1  app/views/admin/countries/_form.html.erb
@@ -7,6 +7,7 @@
7 7 <% end %>
8 8 <%= f.input :description %>
9 9 <%= f.input :value %>
  10 + <%= f.input :number_of_patients %>
10 11 <% end %>
11 12 <%= f.buttons %>
12 13 <% end %>
2  app/views/countries/country_click.js.erb
@@ -2,7 +2,7 @@
2 2 $('#dialog').removeClass('no_result');
3 3 $('#dialog').attr('title', '<%= @country.country_list.name %>');
4 4 $("span.ui-dialog-title").text('<%= @country.country_list.name %>');
5   - $('#dialog').html('<p> Description: <%= @country.description %> </p> <p> Vitiligo: <%= @country.value %> </p>');
  5 + $('#dialog').html('<p> Description: <%= @country.description %> </p> <p> Vitiligo: <%= @country.value %> </p> <p> Number of patients: <%= @country.number_of_patients %> </p>');
6 6 <% else %>
7 7 $('#dialog').addClass('no_result');
8 8 <% end %>
10 db/migrate/20111026093311_add_number_of_patients_to_countries.rb
... ... @@ -0,0 +1,10 @@
  1 +class AddNumberOfPatientsToCountries < ActiveRecord::Migration
  2 + def self.up
  3 + add_column :countries, :number_of_patients, :integer
  4 + end
  5 +
  6 + def self.down
  7 + remove_column :countries, :number_of_patients
  8 + end
  9 +end
  10 +
3  db/schema.rb
@@ -10,7 +10,7 @@
10 10 #
11 11 # It's strongly recommended to check this file into your version control system.
12 12
13   -ActiveRecord::Schema.define(:version => 20111026071721) do
  13 +ActiveRecord::Schema.define(:version => 20111026093311) do
14 14
15 15 create_table "active_admin_comments", :force => true do |t|
16 16 t.integer "resource_id", :null => false
@@ -51,6 +51,7 @@
51 51 t.datetime "created_at"
52 52 t.datetime "updated_at"
53 53 t.integer "country_list_id"
  54 + t.integer "number_of_patients"
54 55 end
55 56
56 57 create_table "country_lists", :force => true do |t|

0 comments on commit 061d37c

Please sign in to comment.
Something went wrong with that request. Please try again.