forked from saurabh/personal-experience
Fix url encode and rescue duration method in model
This commit is contained in:
parent
c4fdd46487
commit
df97b18456
|
@ -17,7 +17,7 @@ class Admin::ExperiencesController < OrbitMemberController
|
|||
@member = MemberProfile.find(experience_params['member_profile_id']) rescue nil
|
||||
@experience = Experience.new(experience_params)
|
||||
@experience.save
|
||||
redirect_to '/admin/members/'+@member.to_param+'/Experience'
|
||||
redirect_to URI.encode('/admin/members/'+@member.to_param+'/Experience')
|
||||
end
|
||||
|
||||
def edit
|
||||
|
@ -30,7 +30,7 @@ class Admin::ExperiencesController < OrbitMemberController
|
|||
@experience = Experience.find(params[:id])
|
||||
@experience.update_attributes(experience_params)
|
||||
@experience.save
|
||||
redirect_to '/admin/members/'+@member.to_param+'/Experience'
|
||||
redirect_to URI.encode('/admin/members/'+@member.to_param+'/Experience')
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
@ -66,7 +66,7 @@ class Admin::ExperiencesController < OrbitMemberController
|
|||
@intro = @intro.nil? ? ExperienceIntro.new({:member_profile_id=>@member.id}) : @intro
|
||||
@intro.update_attributes(intro_params)
|
||||
@intro.save
|
||||
redirect_to '/admin/members/'+@member.to_param+'/Experience'
|
||||
redirect_to URI.encode('/admin/members/'+@member.to_param+'/Experience')
|
||||
end
|
||||
|
||||
def get_settings
|
||||
|
|
|
@ -26,7 +26,11 @@ class Experience
|
|||
before_validation :add_http
|
||||
|
||||
def duration
|
||||
self.start_date.strftime('%Y.%m')+' ~ '+self.end_date.strftime('%Y.%m')
|
||||
if !self.start_date.nil? or !self.end_date.nil?
|
||||
self.start_date.strftime('%Y.%m')+' ~ '+self.end_date.strftime('%Y.%m')
|
||||
else
|
||||
""
|
||||
end
|
||||
end
|
||||
|
||||
def slug_title
|
||||
|
|
Loading…
Reference in New Issue