I need to render an HTML element in rails, depending upon whether a session variable is set or not. Is it possible to do something like this?
Session is server side, I am not a rails developer, but in asp.net mvc I made an ajax call that gets the Session value and returns it back to client. Just an idea.
You cannot access any server side variable from client side. You can basically render the session variable value in a javascript variable and use it on the client side in jquery.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With