diff --git a/app/controllers/contest_notification_controller.rb b/app/controllers/contest_notification_controller.rb index 143941cc0..8c6e51bd5 100644 --- a/app/controllers/contest_notification_controller.rb +++ b/app/controllers/contest_notification_controller.rb @@ -1,5 +1,5 @@ -class ContestNotificationController +class ContestNotificationController < ApplicationController def show - + @notification = ContestNotification.find(params[:id]) end -end \ No newline at end of file +end diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index 4e7cf0ce9..509e5ee1d 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -110,7 +110,7 @@ class WelcomeController < ApplicationController def contest @contest_page = FirstPage.where("page_type = 'contest'").first - @contestNotification = ContestNotification.all.first + @contest_notifications = ContestNotification.order("id desc") end def search diff --git a/app/views/contest_notification/show.html.erb b/app/views/contest_notification/show.html.erb index e69de29bb..93fa1f4af 100644 --- a/app/views/contest_notification/show.html.erb +++ b/app/views/contest_notification/show.html.erb @@ -0,0 +1,24 @@ +
<%= l(:label_contest_innovate ) %> | +<%= l(:label_user_location) %> : | ++ | ++ | +
contest.trustie.net | +<%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'welcome', :action => 'contest' %> > 详情 | +
<%= @notification.title %>
+<%= @notification.content.html_safe %>
+