我希望我的交付控制器接收与此类似的 URL 参数:
https://www.xxxxx.com/messages/delivery?id=ones1sbn&type=1
我的.delivery
动作MessagesController
如下所示:
def delivery
sent_message = SentMessage.find_by_ref(params[:id])
if params[:type] == 1
sent_message.delivery = "Delivered"
sent_message.save()
elsif params[:type] == 2
sent_message.delivery = "Delivery Failure"
sent_message.save()
else
sent_message.save()
end
end
那么路由条目是
resources :messages do
collection do
get 'delivery'
end
end
我无法从传入的 HTTP 请求中接收信息的原因可能是什么?
消息控制器中的过滤器是
before_filter :authenticate_user!, :except => [:delivery, :show]
load_and_authorize_resource :except => [:delivery, :show]
为这个动作耙路线
delivery_messages GET /messages/delivery(.:format) messages#delivery
在所有更新之后,现在是错误;
Template is missing
Missing template messages/delivery, application/delivery with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :slim, :arb]}. Searched in: * "/var/www/html/webapp/app/views" * "/usr/local/lib/ruby/gems/1.9.1/gems/activeadmin-0.6.0/app/views" * "/usr/local/lib/ruby/gems/1.9.1/gems/kaminari-0.14.1/app/views" * "/usr/local/lib/ruby/gems/1.9.1/gems/devise-3.1.0/app/views"
添加了模板,但仍然没有来自 http 请求的更新