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不確定如何更新此記錄,...沒有在應用程序的管理部分是,..任何幫助,將不勝感激。