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?)
This commit is contained in:
Alan Bradburne
2012-02-09 23:42:16 +00:00
parent bfd5b29a9a
commit 4f0354303f
21 changed files with 198 additions and 172 deletions

View File

@ -78,12 +78,12 @@
<br /><br />
<h2><%= t(:channel_clear_message) %></h2>
<%= button_to t(:channel_clear), { :controller => 'channels', :action => 'clear', :id => @channel.id }, :confirm => t(:confirm_channel_clear) %>
<%= button_to t(:channel_clear), clear_channel_path(@channel), :confirm => t(:confirm_channel_clear) %>
<br /><br />
<h2><%= t(:channel_delete_message) %></h2>
<%= button_to t(:channel_delete), channel_path(@channel.id), :method => 'delete', :confirm => t(:confirm_channel_delete) %>
<%= button_to t(:channel_delete), channel_path(@channel), :method => 'delete', :confirm => t(:confirm_channel_delete) %>
<script type="text/javascript">
// remember default field label

View File

@ -6,7 +6,7 @@
<%= t(:upload_select) %>
<br /><br />
<%= form_for :upload, :url => {:controller => 'channels', :action => 'upload', :channel_id => params[:channel_id]}, :html => { :multipart => true } do |f| %>
<%= form_for :upload, :url => upload_channel_path(@channel), :html => { :multipart => true } do |f| %>
<%= f.file_field :csv %>
<br /><br />
<%= t(:time_zone) %>