2017-03-22 21 views
-1

OS Windows-Ruby on Rails, atom

ich eine Aktion mit dem Controller hinzugefügt

def who_bought 
@product = Product.find(params[:id]) 
@latest_order = @product.orders.order(:updated_at).last 
if stale?(@latest_order) 
    respond_to do |format| 
    format.html 
    format.atom 
    end 
end 
end 

Dann habe ich eine Datei who_bougth.atom.builder

im Browser localhost eingeben: 3000/Produkte/3/who_bought.atom

Eine Fehlermeldung

 ProductsController#who_bought is missing a template for this request format  and variant. request.formats: ["application/atom+xml"] request.variant: [] 
angezeigt wird,
+1

Ihre Schreibweise für Datei who_bougth.atom.builder ist falsch sollte es sein who_bought.atom.builder –

+0

Danke, ich habe dies nicht gesehen –

+0

@RazvitOk Ich habe dies als eine Antwort geschrieben, wenn Sie meine Antwort als akzeptiert markieren könnten. –

Antwort

0

Überprüfen Sie Ihre Schreibweise für die Datei who_bougth.atom.builder d. H. Ist inkorrekt, stattdessen sollte es who_bought.atom.Builder sein.