vhochstein / active_scaffold

Rails 4 Version of activescaffold supporting jquery
MIT License
156 stars 34 forks source link

Fixes for complex table name with schema, and view output for restriction #183

Closed Strech closed 13 years ago

Strech commented 13 years ago

Fixes for complex table name with schema, and view output for restriction authoraized_for_smth?

vhochstein commented 13 years ago

I totally agree with your column.rb change. However, you change to action_group.html.erb will generate errors. Why do you need that one, can you please give me an example?

Strech commented 13 years ago

if model has an autoraizedfor#{action}? method, and in controller u have an action link, described than action method in a model, in list view u see &lgt;a ...&rgt;Action&lgt;\a&rgt; when it was a disabled

class Test < ActiveRecord::Base
  def authoraized_for_pewpew?
    false
  end
end

class Admin::AwsomeController < Admin::BaseController
  active_scaffold :test do
    config.action_links.add('Action', {
       :action => :pewpew,
       :type   => :member,
       :method => :get,
       :inline => false,
       :page => true
     })
  end
end

By the way in else condition a don't see any sanitizing

<% if options[:level] == 0 %>
  <%= "#{start_level_0_tag}#{render_group_action_link(link, url_options, options, record)}#{end_level_0_tag}".html_safe %>
<% else %>
  <%= content_tag('li', render_group_action_link(link, url_options, options, record), options[:first_action] ? {:class => 'top'}: {}) %>
<% end %>

And check this https://github.com/activescaffold/active_scaffold/pull/63

Strech commented 13 years ago

Oops, i closed pull request, and opened it again, sry :)

vhochstein commented 13 years ago

Ok, else path argument convinced me. :-)

vhochstein commented 13 years ago

Thanks a lot for providing this fix

Strech commented 13 years ago

Thank u for merging it