I am new to Ruby on Rails.
In an action, I need to dynamically generate a partial with encoded content and display it as a popup via data-uri:
Controller
def dashboard
@surprise = get_deal(srand % current_user.dob_year)
end
def get_deal(magic_number)
if magic_number < 500
return "<h5>You have won a voucher #{VoucherFactory.unused_in_the_queue}</h5>"
end
end
Now, in view I need something like :partial=>@surprise without saving the file.
You can simply render the @surprise in view: