应用程序在heroku和localhost中的行为方式不同

时间:2014-08-06 00:33:00

标签: ruby-on-rails ruby heroku

在我的申请中,我正在制作活动。当我销毁它们时,一旦用户被重定向到事件#index页面,就会出现一个闪烁。这是破坏行动:

def destroy
        @event = Event.find(params[:id])
        @event.destroy
        redirect_to events_path
        flash[:notice] = 'Event destroyed!'
    end

这在localhost上运行正常。但是,一旦应用程序被推送到Heroku,它就无法运行。单击时,用户将进入特定事件的显示页面。这也是按钮的link_to。关于为什么会这样的线索?

<button>
    <%=link_to('Destroy Event', event, method: :delete, data: {confirm: "Are you sure you want to delete the '#{event.name}' event?"}) %>
</button>

0 个答案:

没有答案