mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-30 20:23:14 +08:00
fixed new project form
This commit is contained in:
parent
8f24d0d80c
commit
fa36488397
2 changed files with 4 additions and 12 deletions
|
@ -47,14 +47,14 @@ class ProjectsController < ApplicationController
|
|||
|
||||
def new
|
||||
@project = Project.new
|
||||
@organizations = current_user.organizations
|
||||
end
|
||||
|
||||
def create
|
||||
@project = Project.new(project_params)
|
||||
@project.created_by = current_user
|
||||
@project.last_modified_by = current_user
|
||||
if @project.save
|
||||
if current_organization.id == project_params[:organization_id].to_i &&
|
||||
@project.save
|
||||
# Create user-project association
|
||||
up = UserProject.new(
|
||||
role: :owner,
|
||||
|
|
|
@ -1,15 +1,7 @@
|
|||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
<%= form.text_field :name, label: t("projects.index.modal_new_project.name"), autofocus: true, placeholder: t("projects.index.modal_new_project.name_placeholder") %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
<div class="form-group">
|
||||
<%= form.label t("projects.index.modal_new_project.organization") %>
|
||||
<%= collection_select(:project, :organization_id, @organizations, :id, :name, {}, { :class => "form-control"} ) %>
|
||||
</div>
|
||||
<%= hidden_field :project, :organization_id, value: current_organization.id %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in a new issue