Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/opengl/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 在侧边栏上显示某些字段和提交按钮的最简单方法(一个la WordPress)?_Ruby On Rails - Fatal编程技术网

Ruby on rails 在侧边栏上显示某些字段和提交按钮的最简单方法(一个la WordPress)?

Ruby on rails 在侧边栏上显示某些字段和提交按钮的最简单方法(一个la WordPress)?,ruby-on-rails,Ruby On Rails,所以,我想归档如下内容: 我希望在侧边栏中有标记、图像字段、提交和另存为草稿提交按钮 现在的结构是这样的: new.html.erb: <% provide(:title, 'Create post') %> <h1 class="navless-title">Create post</h1> <%= form_for(@post, remote: true, :html => { :multipart => true }) do |

所以,我想归档如下内容:

我希望在侧边栏中有标记、图像字段、提交和另存为草稿提交按钮

现在的结构是这样的:

new.html.erb:

<% provide(:title, 'Create post') %>

<h1 class="navless-title">Create post</h1>

<%= form_for(@post, remote: true, :html => { :multipart => true }) do |f| %>
  <%= render 'fields', f: f %>
  <div class="form-actions">
    <%= f.submit "Publish", class: "publish btn btn-primary pull-left" %>
    <%= f.submit "Save Draft", class: "save-draft btn btn-default pull-left" %>
    <div class="busy pull-left"></div>
  </div>
<% end %>
<%= render 'shared/error_messages', object: f.object %>

<%= f.label :title %>
<%= f.text_field :title %>

<%= f.label :content %>
<%= f.text_area :content, id: "wysihtml5-textarea" %>

<%= f.label :tag_list, "Tags" %>
<%= f.text_field :tag_list, "data-pre" => @post.tags.map(&:attributes).to_json %>

<%= f.label :image %>
<%= f.file_field :image %>

<p class="status">
  <% if @post.id? && @post.status == "Draft" %>
    Status: <span class="label"><%= @post.status %></span>
  <% elsif @post.id? && @post.status == "Published" %>
    Status: <span class="label label-primary"><%= @post.status %></span>
  <% end %>
</p>

<%= render 'shared/editor_toolbar' %>

创建帖子
{:multipart=>true})do | f |%>
fields.html.erb:

<% provide(:title, 'Create post') %>

<h1 class="navless-title">Create post</h1>

<%= form_for(@post, remote: true, :html => { :multipart => true }) do |f| %>
  <%= render 'fields', f: f %>
  <div class="form-actions">
    <%= f.submit "Publish", class: "publish btn btn-primary pull-left" %>
    <%= f.submit "Save Draft", class: "save-draft btn btn-default pull-left" %>
    <div class="busy pull-left"></div>
  </div>
<% end %>
<%= render 'shared/error_messages', object: f.object %>

<%= f.label :title %>
<%= f.text_field :title %>

<%= f.label :content %>
<%= f.text_area :content, id: "wysihtml5-textarea" %>

<%= f.label :tag_list, "Tags" %>
<%= f.text_field :tag_list, "data-pre" => @post.tags.map(&:attributes).to_json %>

<%= f.label :image %>
<%= f.file_field :image %>

<p class="status">
  <% if @post.id? && @post.status == "Draft" %>
    Status: <span class="label"><%= @post.status %></span>
  <% elsif @post.id? && @post.status == "Published" %>
    Status: <span class="label label-primary"><%= @post.status %></span>
  <% end %>
</p>

<%= render 'shared/editor_toolbar' %>

@post.tags.map(&:attributes).to_json%>

地位: 地位:

所以,我不知道该怎么办;使用绝对定位、jQuery或将表单切成两半(不确定这是否可行)

最简单的方法是什么