0

I have internal javascript written in an html.erb file in my rails project.

<!-- walkscript.html.erb -->
<script type="text/javascript">
 var user_login = '<%= current_user.try(:login) %>';
  (function() {
    var walkme = document.createElement('script');
    walk.type = 'text/javascript';
    walk.async = true;
    walk.src = ''
  })();
</script>

And I am using the settingslogic gem for settings solution in my project, which accesses the settings as Settins.setting_name in my project. I have a setting in my application.yml by the name js_url. How do I add it to the walk.src in my html.erb file ?

0

1 Answer 1

0

Use ERB tags, just like you do for user_login

walk.src = "<%= Settings.js_url %>"

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.