Note that there are some explanatory texts on larger screens.

plurals
  1. POAccess View as Modal
    text
    copied!<p>I am trying to access one of my edit views as a modal in my application. I have my Show.html in readings as shown here</p> <pre><code>&lt;%- model_class = Reading -%&gt; &lt;div class="page-header"&gt; &lt;h1&gt;&lt;%=t '.title', :default =&gt; model_class.model_name.human %&gt;&lt;/h1&gt; &lt;/div&gt; &lt;dl class="dl-horizontal"&gt; &lt;dt&gt;&lt;strong&gt;&lt;%= model_class.human_attribute_name(:customer_id) %&gt;:&lt;/strong&gt;&lt;/dt&gt; &lt;dd&gt;&lt;%= @reading.customer_id %&gt;&lt;/dd&gt; &lt;dt&gt;&lt;strong&gt;&lt;%= model_class.human_attribute_name(:date_of_reading) %&gt;:&lt;/strong&gt;&lt;/dt&gt; &lt;dd&gt;&lt;%= @reading.date_of_reading %&gt;&lt;/dd&gt; &lt;dt&gt;&lt;strong&gt;&lt;%= model_class.human_attribute_name(:reading1) %&gt;:&lt;/strong&gt;&lt;/dt&gt; &lt;dd&gt;&lt;%= @reading.reading1 %&gt;&lt;/dd&gt; &lt;dt&gt;&lt;strong&gt;&lt;%= model_class.human_attribute_name(:reading2) %&gt;:&lt;/strong&gt;&lt;/dt&gt; &lt;dd&gt;&lt;%= @reading.reading2 %&gt;&lt;/dd&gt; &lt;dt&gt;&lt;strong&gt;&lt;%= model_class.human_attribute_name(:reading3) %&gt;:&lt;/strong&gt;&lt;/dt&gt; &lt;dd&gt;&lt;%= @reading.reading3 %&gt;&lt;/dd&gt; &lt;/dl&gt; &lt;div class="form-actions"&gt; &lt;%= link_to t('.back', :default =&gt; t("helpers.links.back")), customer_readings_path, :class =&gt; 'btn' %&gt; &lt;%= link_to t('.edit', :default =&gt; t("helpers.links.edit")), edit_customer_reading_path(@reading.customer, @reading), :class =&gt; 'btn', :data =&gt; {:toggle =&gt; "modal", :target =&gt; "#editItemModal"} %&gt; &lt;%= link_to t('.destroy', :default =&gt; t("helpers.links.destroy")), customer_reading_path(@reading.customer), :method =&gt; 'delete', :data =&gt; { :confirm =&gt; t('.confirm', :default =&gt; t("helpers.links.confirm", :default =&gt; 'Are you sure?')) }, :class =&gt; 'btn btn-danger' %&gt; &lt;/div&gt; </code></pre> <p>In my edit View, readings/edit</p> <pre><code>&lt;div id= "editItemModal" class="modal hide fade" tabindex="-1" role="dialog"&gt; &lt;button type="button" class="close" data-dismiss="modal"&gt;x&lt;/button&gt;&lt;/h1&gt; &lt;div class = "page-header"&gt; &lt;h1&gt; Editing Readings &lt;/h1&gt; &lt;/div&gt; &lt;%= render 'form_reading'%&gt; &lt;/div&gt; </code></pre> <p>However, on clicking edit in my show, the edit view does not show up as a modal, it just shows a blank page. What can i be missing?</p>
 

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