2014-01-22 2 views
0

여러 개의 앱 프록시 위치를 추가하려고했지만 여러 개의 링크가 내 애플리케이션에 저장되지 않은 것처럼 보입니다. 현재 양식이 잘 보이지만 제출할 때 처리 방법이 확실하지 않습니까? Ajax로 제출하고 메시지를 렌더링 하시겠습니까? 이것은 현재로서는 내 컨트롤러이지만 제출할 때 액션을 생성하는 것을 전혀 명중하지 않습니다.제출 양식이 포함 된 Shopify 앱 프록시가 올바르게 제출되지 않습니다.

class ProductsController < ApplicationController 
    before_filter :customer_authenticate 

    def create 
     product = Product.create(params[:product]) 
     if product.update_attribute(:shopify_id, product.set_up_product) 
      flash[:notice] = 'Product was successfully submitted' 
      redirect_to new_products_url 
     else 
      flash[:notice]= product.errors.full_messages 
      redirect_to :back 
     end 
    end 

    def new 
     if params[:shop].present? && @store = Store.find_by_shopify_url(params['shop']) 
     render layout: false, content_type: 'application/liquid' 
     else 
     flash[:notice] = 'Application is not setup with store, please try again' 
     redirect_to welcome_url 
     end 
    end 

    private 

    def customer_authenticate 
    if params['shop'] 
     store = Store.find_by_shopify_url(params['shop']) 
    else 
     store = Store.find(params[:store_id]) 
    end 
    sess = ShopifyAPI::Session.new(store.shopify_url, store.access_token) 
    ShopifyAPI::Base.activate_session(sess) 
    session[:shopify] = sess 
    end 
end 

답변

0

사이트가 프록시를 통해 액세스되었으므로 URL 도우미가 작동하지 않아 양식에서 아래 위치를 지정해야했지만 제대로 작동합니다.

<%= form_for(@product, url: ENV['HOME_URL'] + "/products", method: :post, html: {multipart: true}) do |f| %> 
관련 문제