Skip to content

Instantly share code, notes, and snippets.

@bjhaid
Created July 19, 2011 16:56
Show Gist options
  • Save bjhaid/1093055 to your computer and use it in GitHub Desktop.
Save bjhaid/1093055 to your computer and use it in GitHub Desktop.
index.js.erb
1 if (<%=Switchvox.last.exten_number%> == 4101) {
2 $.modal("#boxes");
3 }
4 //http://www.ericmmartin.com/projects/simplemodal/
index.html.erb
<h1>Listing switchvoxes</h1>
2 <%= render 'call' %>
3 <table>
4 <tr>
5 <th>Cid number</th>
6 <th>Exten number</th>
7 <th></th>
8 <% if user_signed_in? %>
9 <th><%= current_user.username %></th>
10 <% end %>
11 <th></th>
12 <th></th>
13 </tr>
14 <div id=switchvoxes data-user="4560">
15 <% Switchvox.all.each do |switchvox| %>
16 <tr>
17 <div id = "call" data-id="<%=switchvox.id%>" data-time="<%=switchvox.created_at.to_i%>" data-exten="<%=switchvox.exten _number%>" >
18 <td><%= switchvox.cid_number %></td>
19 <td><%= switchvox.exten_number %></td>
20 <td><%= link_to 'Show', switchvox %></td>
21 <td><%= link_to 'Destroy', switchvox, :confirm => 'Are you sure?', :method => :delete %></td>
22 </div>
23 </tr>
24 </div>
25 <% end %>
_call.html.erb
1 <table>
2 <div id="boxes">
3 <tr>
4 <td><%= label_tag("Enter number:") %></td>
5 <td><%= text_field_tag(:outgoing_number) %> <%=image_tag("dial.png", :size => "20x20")%></td>
6 </tr>
7 <tr colspan = 2>
8 <td> Contact information: <br>
9 <% contact = @contact %>
10 <table>
11 <% unless contact.nil? %>
12 <tr>
13 <td>Name: </td>
14 <td><%= contact.last_name.capitalize %>, <%= contact.first_name.capitalize %><br></td></tr>
15 <tr>
16 <td>Frequent flyer airline: </td>
17 <td> <%= contact.cstm_frequent_flyer_airline1_c %><br>
18 <%= contact.cstm_frequent_flyer_airline2_c %><br>
19 <%= contact.cstm_frequent_flyer_airline3_c %><br></td>
20 </tr>
21 <tr><td> Customer id: </td>
22 <td><%= contact.cstm_customer_id_c %></td></tr>
23 <tr>
24 <td>Fax: </td>
25 <td><%= contact.phone_fax %></td>
26 </tr>
@bjhaid
Copy link
Author

bjhaid commented Jul 20, 2011

Modal box not popping up, i got the jquery plugin off //http://www.ericmmartin.com/projects/simplemodal/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment