I'm using rails 2.3.4 & ruby 1.8.7
I'm trying to print a instance variable in my application.
The instance variable is getting initialized in a method in deal_portal/base_controller.rb
, while the view is rendered from a method in deal_portal/mobile_controller
. When I view the page, the value of instance variable is not present, but once the开发者_开发百科 page is refreshed the value is displayed.
What could be the cause of delay as this happens only in production
EDIT:
deal_portal/base_controller.rb
def validate_trans
@voucher_urls = payment_info["voucher_urls"]
end
deal_portal/mobile_controller.rb
class DealPortal::MobileController < DealPortal::BaseController
def payment_success
render :template => "deal_portal/mobile/payment_success.html.erb"
end
end
deal_portal/mobile_native_app_controller.rb
class DealPortal::MobileNativeAppController < DealPortal::BaseController
before_filter :validate_trans, :only => [:payment_success]
end
Now in the view file payment_success.html.erb
after the puchase is made, the @voucher_urls
is not displayed and after refreshing the page, it becomes visible.
精彩评论