Commit 1b83af6e authored by Alex Denisov's avatar Alex Denisov

IssueController#new refactored

parent f7894762
...@@ -137,10 +137,10 @@ function updateNewIssueURL(){ ...@@ -137,10 +137,10 @@ function updateNewIssueURL(){
var assignee_id = $("#assignee_id").val(); var assignee_id = $("#assignee_id").val();
var new_href = ""; var new_href = "";
if(milestone_id){ if(milestone_id){
new_href = "milestone_id=" + milestone_id + "&"; new_href = "issue[milestone_id]=" + milestone_id + "&";
} }
if(assignee_id){ if(assignee_id){
new_href = new_href + "assignee_id=" + assignee_id; new_href = new_href + "issue[assignee_id]=" + assignee_id;
} }
if(new_href.length){ if(new_href.length){
new_href = new_issue_link.attr("href") + "?" + new_href; new_href = new_issue_link.attr("href") + "?" + new_href;
......
...@@ -37,9 +37,7 @@ class IssuesController < ApplicationController ...@@ -37,9 +37,7 @@ class IssuesController < ApplicationController
end end
def new def new
@issue = @project.issues.new @issue = @project.issues.new(params[:issue])
@issue.milestone_id = params[:milestone_id] if params[:milestone_id].present?
@issue.assignee_id = params[:assignee_id] if params[:assignee_id].present?
respond_with(@issue) respond_with(@issue)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment