Updating settings & fixing auth of objects through other objects cancan bug?

This commit is contained in:
2013-09-28 19:31:28 -07:00
parent 9e08a0d036
commit 42679aa410
7 changed files with 14 additions and 39 deletions

View File

@@ -8,11 +8,10 @@ $(function(){
<h3>Editing <%= @setting[:var].titleize %></h3>
<div class="field">
<%= text_area_tag :value, @setting[:value], :cols => 50, :class => "wysiwyg" %><br/>
<em>Use %{provider_name} or %{client_name} to include names in messages.</em>
</div>
<div class="field">
<%= submit_tag "Save", {:class => "wymupdate"} %><br/>
<%= link_to "Back", settings_path %>
</div>
<% end %>
<% end %>

View File

@@ -7,10 +7,10 @@
<% @settings.each do |setting| %>
<tr>
<td><%= setting.first.titleize %></td>
<td>"<%= setting.last %>"</td>
<td>"<%= setting.last.truncate(140) %>"</td>
<% if can? :update, setting %>
<td><%= link_to 'Edit', edit_setting_path(setting.first) %></td>
<% end %>
</tr>
<% end %>
</table>
</table>