thingspeak/app/views/api_keys/index.html.erb
Alan Bradburne 4f0354303f Improve channel, user and api_key models with basic scopes, correct references and protect attributes.
Simplify channels & user controllers and models, moving code to the models.
Remove catch-all route and ensure all actions are specified, fixing url paths.
Change clone to dup in feed_controller as using clone seems to affect the cloned object (problem only in ruby 1.9.3?)
2012-02-09 23:42:16 +00:00

44 lines
1.4 KiB
Plaintext

<h2>
<%= link_to t(:channels), channels_path %> &raquo;
<%= link_to channel_path(@channel.id) do %> <%= t(:channel) %> <%= @channel.id %><% end %> &raquo;
<%= t(:api_keys) %>
</h2>
<h3><%= t(:api_key_write) %></h3>
<%= @write_key %>
<br /><br />
<%= button_to t(:api_key_write_new), channel_api_keys_path(@channel, :write => 1), :confirm => t(:confirm_new_api_key) %>
<br /><br />
<h3><%= t(:api_key_read) %></h3>
<% @read_keys.each do |read_key| %>
<table>
<tr>
<td><%= t(:api_key_key) %>:</td>
<td><%= read_key %></td>
</tr>
<tr>
<td class="VAT"><%= t(:note) %>:</td>
<td>
<%= form_for read_key, :as => :api_key, :url => channel_api_key_path(@channel, read_key), :html => {:method => 'put'} do |f| %>
<%= f.text_area :note, :cols => 30, :rows => 4 %>
</td>
</tr>
<tr>
<td></td>
<td>
<div class="FL"><%= f.submit t(:note_save) %></div>
<% end %>
<%= button_to t(:api_key_delete), channel_api_key_path(@channel, read_key) , :method => 'delete', :confirm => t(:confirm_read_key_delete) %></td>
</tr>
</table>
<br /><br />
<% end %>
<%= button_to t(:api_key_read_new), channel_api_keys_path(@channel, :write => 0) %>
<br />