diff --git a/app/models/home.rb b/app/models/home.rb index ae85070c4..88ee59aff 100644 --- a/app/models/home.rb +++ b/app/models/home.rb @@ -4,6 +4,10 @@ class Home < ActiveRecord::Base has_one :cover, as: :coverable, dependent: :destroy has_many :banners, dependent: :destroy + # validates_presence_of :name, :content, :frendly_id + # validates_format_of :friendly_id, :with => /\A[a-z0-9\-]+\z/ + + # before_validation :generate_friendly_id, :on => :create validates_presence_of :name, :content def more_content? diff --git a/app/views/account/_introduce_activities.html.erb b/app/views/account/_introduce_activities.html.erb new file mode 100644 index 000000000..da59074b6 --- /dev/null +++ b/app/views/account/_introduce_activities.html.erb @@ -0,0 +1,74 @@ +
+ 首页> + 行业动态 +
+社区动态
++ 工业互联网体系架构2.0 + 行业动态 + 2019-03-01 +
++ 网易考拉是网易在 2015 年 1 月上线公测的一项跨境电商业务,该业务一开始的品牌名称为 “考拉海购”。 +
++ 工业互联网体系架构2.0 + 行业动态 + 2019-03-01 +
++ 网易考拉是网易在 2015 年 1 月上线公测的一项跨境电商业务,该业务一开始的品牌名称为 “考拉海购”。 +
++ 工业互联网体系架构2.0 + 行业动态 + 2019-03-01 +
++ 网易考拉是网易在 2015 年 1 月上线公测的一项跨境电商业务,该业务一开始的品牌名称为 “考拉海购”。 +
++ 工业互联网体系架构2.0 + 行业动态 + 2019-03-01 +
++ 网易考拉是网易在 2015 年 1 月上线公测的一项跨境电商业务,该业务一开始的品牌名称为 “考拉海购”。 +
++ 工业互联网体系架构2.0 + 行业动态 + 2019-03-01 +
++ 网易考拉是网易在 2015 年 1 月上线公测的一项跨境电商业务,该业务一开始的品牌名称为 “考拉海购”。 +
+<%= truncate(home.content.html_safe, length: Home::SHOW_CONTENT_LENGTH) %>
- MORE→ + diff --git a/app/views/homes/index.html.erb b/app/views/homes/index.html.erb index 56f3d87ce..a3b10aa35 100644 --- a/app/views/homes/index.html.erb +++ b/app/views/homes/index.html.erb @@ -50,4 +50,4 @@ - + \ No newline at end of file diff --git a/app/views/layouts/base_project_community.html.erb b/app/views/layouts/base_project_community.html.erb index 1df368b8d..387d63270 100644 --- a/app/views/layouts/base_project_community.html.erb +++ b/app/views/layouts/base_project_community.html.erb @@ -80,6 +80,7 @@ + <%= render :partial => 'layouts/footer' %> diff --git a/app/views/users/project_community.html.erb b/app/views/users/project_community.html.erb index 42b7caa97..2e7b12a70 100644 --- a/app/views/users/project_community.html.erb +++ b/app/views/users/project_community.html.erb @@ -1,3 +1,4 @@ +