From 9b9e8a6d89160b22943a61083017436137e9c591 Mon Sep 17 00:00:00 2001 From: manson Date: Fri, 4 Jul 2014 15:08:46 +0800 Subject: [PATCH] Update fields --- app/models/patent.rb | 2 +- app/views/admin/patents/_form.html.erb | 24 +++++++++++------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/app/models/patent.rb b/app/models/patent.rb index f215813..063fac1 100644 --- a/app/models/patent.rb +++ b/app/models/patent.rb @@ -9,12 +9,12 @@ class Patent field :patent_title, as: :slug_title, localize: true field :authors, localize: true + field :patent_country, localize: true field :year field :language field :keywords field :patent_no - field :patent_country field :publish_date , :type => Date field :url field :note diff --git a/app/views/admin/patents/_form.html.erb b/app/views/admin/patents/_form.html.erb index b2bc1b2..c39dac7 100644 --- a/app/views/admin/patents/_form.html.erb +++ b/app/views/admin/patents/_form.html.erb @@ -73,14 +73,6 @@ - -
- -
- <%= f.text_field :patent_country %> -
-
-
@@ -93,11 +85,7 @@
- + <%= f.text_field :language ,class: "span5"%>
@@ -160,6 +148,16 @@
+ +
+ +
+ <%= f.fields_for :patent_country_translations do |f| %> + <%= f.text_field locale, placeholder: t("personal_patent.patent_country"), value: (@patent.patent_country_translations[locale] rescue nil) %> + <% end %> +
+
+