fixed intro

This commit is contained in:
Harry Bomrah 2016-04-06 02:10:42 +08:00
parent 1940ed789c
commit ab1a8c20ac
2 changed files with 3 additions and 3 deletions

View File

@ -43,9 +43,9 @@ class Admin::CertificatesController < OrbitMemberController
end end
def update_frontend_setting def update_frontend_setting
@member = MemberProfile.find(intro_params['member_profile_id']) rescue nil @member = MemberProfile.find(params['member_profile_id']) rescue nil
@intro = CertificateIntro.find_by(:member_profile_id=>@member.id) rescue nil @intro = CertificateIntro.find_by(:member_profile_id=>@member.id) rescue nil
@intro = @intro.nil? ? CourseIntro.new({:member_profile_id=>@member.id}) : @intro @intro = @intro.nil? ? CertificateIntro.new({:member_profile_id=>@member.id}) : @intro
@intro.update_attributes(intro_params) @intro.update_attributes(intro_params)
@intro.save @intro.save
redirect_to URI.encode('/admin/members/'+@member.to_param+'/Certificate') redirect_to URI.encode('/admin/members/'+@member.to_param+'/Certificate')

View File

@ -3,7 +3,7 @@
<%= stylesheet_link_tag "lib/main-list" %> <%= stylesheet_link_tag "lib/main-list" %>
<% end %> <% end %>
<%= form_for(:course_intro, :url => update_frontend_setting_admin_courses_path, :method => "post", html: {class: "form-horizontal main-forms previewable"} ) do |f| %> <%= form_for(:certificate_intro, :url => update_frontend_setting_admin_certificates_path, :method => "post", html: {class: "form-horizontal main-forms previewable"} ) do |f| %>
<fieldset> <fieldset>
<!-- Input Area --> <!-- Input Area -->
<div class="input-area"> <div class="input-area">