I have a Cappuccino app that I am integrating with a Rails backend. A key feature of the app is authentication which is managed entirely by rails. The way I set it up is that the cappuccino js conditionally executes if the user is logged in, like this:
<% if signed_in? %>
<div id="cappuccino-body">
<script type="text/javascript">
document.write("Hello World")
</script>
</div>
<% end %>
where signed_in?
is a rails method that returns a boolean value reflecting whether the user is authenticated.
The issue I am having is two fold, first, I put this script into the show user view, when I drop the cappuccino .j files into app/views/users directory, they are not detected. Where in the rails directory structure do I drop these files in? Is it in public? or in assets?
Second is can I take the embedded ruby conditional statement above, and use it in a separate erb file? (one that isn't associated with any of the standard views but still has access to the rails methods in the backend)