0
我在我的应用程序中有一个命名空间管理员,在这里你可以删除一个客户端,这很好。 在应用程序的管理员之外,@current_user有机会编辑客户的地址。命名空间管理之外的更新记录[rails]
我不知道如何访问它并将新更新保留到数据库。这是我迄今为止
products_controller.rb(其中部分是从渲染)
class ProductsController < ActionController::Base
layout "application"
def index
@products = Product.all
end
def show
@products = Product.all
@current_user = Client.find_by(id: session[:client])
end
end
_overlay_checkout.html.erb(此填充与客户端的形式从数据库地址,如果其没有更新,他们可以改变它。)
<%= simple_form_for([:admin, @current_user], :url => edit_admin_client_path) do |f| %>
<%= f.text_field :address %><br />
<%= f.text_field :address_line_2 %><br />
<%= f.select(:state, options_for_select(us_states, "CA")) %> <br />
<%= f.text_field :zipcode %><br />
<%= f.text_field :city %><br />
<%= f.submit %>
<% end %>
IM不确定如何更新此记录,...没有在应用程序的管理部分是,..任何帮助,将不胜感激。