diff --git a/app/controllers/problems_controller.rb b/app/controllers/problems_controller.rb index 7a11d0d..a1759a3 100644 --- a/app/controllers/problems_controller.rb +++ b/app/controllers/problems_controller.rb @@ -6,7 +6,6 @@ # COLLECTION => :index, :all, :destroy_several, :resolve_several, :unresolve_several, :merge_several, :unmerge_several, :search class ProblemsController < ApplicationController - include ProblemsSearcher before_filter :need_selected_problem, :only => [ @@ -62,7 +61,7 @@ class ProblemsController < ApplicationController end def create_issue - body = "" # TODO render_issue_body + body = render_to_string "issue_trackers/issue", layout: false, formats: [:txt] title = "[#{ problem.environment }][#{ problem.where }] #{problem.message.to_s.truncate(100)}" issue = Issue.new(problem: problem, user: current_user, title: title, body: body) diff --git a/app/views/issue_trackers/issue.txt.erb b/app/views/issue_trackers/issue.txt.erb new file mode 100644 index 0000000..46379f0 --- /dev/null +++ b/app/views/issue_trackers/issue.txt.erb @@ -0,0 +1,45 @@ +[See this exception on Errbit](<%= app_problem_url problem.app, problem %> "See this exception on Errbit") +<% if notice = problem.notices.first %> +# <%= notice.message %> # +## Summary ## +<% if notice.request['url'].present? %> +### URL ### +[<%= notice.request['url'] %>](<%= notice.request['url'] %>)" +<% end %> +### Where ### +<%= notice.where %> + +### Occured ### +<%= notice.created_at.to_s(:micro) %> + +### Similar ### +<%= (notice.problem.notices_count - 1).to_s %> + +## Params ## +``` +<%= pretty_hash(notice.params) %> +``` + +## Session ## +``` +<%= pretty_hash(notice.session) %> +``` + +## Backtrace ## +``` +<% notice.backtrace_lines.each do |line| %><%= line.number %>: <%= line.file_relative %> -> **<%= line.method %>** +<% end %> +``` + +## Environment ## + +
<%= key %>: | +<%= val %> | +