##// END OF EJS Templates
Validates user's mail_notification and turn options into strings (the attribute type)....
Validates user's mail_notification and turn options into strings (the attribute type). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4494 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r4060:deed1b949d63
r4380:e4f319fe6122
Show More
previews_controller.rb
33 lines | 957 B | text/x-ruby | RubyLexer
/ app / controllers / previews_controller.rb
Eric Davis
Refactor: move IssuesController#preview to a new controller....
r3832 class PreviewsController < ApplicationController
before_filter :find_project
def issue
@issue = @project.issues.find_by_id(params[:id]) unless params[:id].blank?
if @issue
@attachements = @issue.attachments
@description = params[:issue] && params[:issue][:description]
if @description && @description.gsub(/(\r?\n|\n\r?)/, "\n") == @issue.description.to_s.gsub(/(\r?\n|\n\r?)/, "\n")
@description = nil
end
@notes = params[:notes]
else
@description = (params[:issue] ? params[:issue][:description] : nil)
end
render :layout => false
end
Eric Davis
Refactor: move NewsController#preview to PreviewsController#news...
r4060 def news
@text = (params[:news] ? params[:news][:description] : nil)
render :partial => 'common/preview'
end
Eric Davis
Refactor: move IssuesController#preview to a new controller....
r3832 private
def find_project
project_id = (params[:issue] && params[:issue][:project_id]) || params[:project_id]
@project = Project.find(project_id)
rescue ActiveRecord::RecordNotFound
render_404
end
end