Note that there are some explanatory texts on larger screens.

plurals
  1. PORender html.erb (not partial) in other html.erb
    primarykey
    data
    text
    <p>I'm quite new to Rails and trying to make app with Foundation framework. The problem is with modal window.</p> <p>I have an <code>index.html.erb</code> file in <code>views/users</code> folder, generated by scaffold. Also there is a <code>new.html.erb</code> file in the same folder.</p> <p>I want to open <code>../users/new</code> link in modal window on index page.</p> <p>I used examples in <a href="http://foundation.zurb.com/docs/components/reveal.html" rel="nofollow noreferrer">Reveal (Foundation Documentation)</a>, put <code>new.html.erb</code> file content in:</p> <pre><code>&lt;div id="myModal" class="reveal-modal"&gt; . . &lt;/div&gt; </code></pre> <p>Also, add to New User link "href" attribute.</p> <pre><code>&lt;%= link_to 'New User', new_user_path, 'data-reveal-id' =&gt; 'myModal' %&gt; </code></pre> <p>as was described <a href="https://stackoverflow.com/questions/8729223/how-to-pass-an-object-to-a-reveal-modal-pop-up-window">here</a>.</p> <p>Now I need to render <code>new.html.erb</code> in <code>index.html.erb</code>, cause I need this code just before /body tag, as described in Foundation Docs.</p> <p>I've tried to render it as partial, but it doesn't work.</p> <p>Is there any way to do it, without double <code>new.html.erb</code> as <code>_new.html.erb</code> and inserting it as partial in <code>index.html.erb</code>?</p> <p>I don't think, that RoR with all there's "Write less code!" stuff, doesn't have the way for do it without code duplicating.</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload