Code Monkey home page Code Monkey logo

admin_data's Introduction

admin_data

Rails 3.0.x

If you are using Rails 3.0.x then use

gem 'admin_data', '= 1.1.14'

Rails 3.1.x

If you are using Rails 3.1.x then use

gem 'admin_data', '= 1.2.1'

Also add following lines to config/application.rb just below the line that says config.assets.enabled = true .

config.assets.precompile += ['admin_data.css', 'admin_data.js']

Before deploying the code to production execute

bundle exec rake assets:precompile

Live Demo

Live demo is available at http://admin-data-demo.heroku.com/admin_data (read only version)

Docs

Documentation is available at https://github.com/bigbinary/admin_data/wiki

Tests

To execute tests for this gem cd test/rails_root and read the instructions mentioned at README.md there.

License

Released under MIT License

admin_data's People

Contributors

adamcrown avatar alexrothenberg avatar axs89 avatar chetan avatar chrismccord avatar chrisvariety avatar comboy avatar jgeiger avatar jpshackelford avatar mperham avatar pacoguzman avatar snaury avatar subbarao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

admin_data's Issues

Load models in plugins

Hi!

This plugin is awesome! very awesome I think.

But know I'm building an application that use desert to load some plugins you can see it here http://github.com/pacoguzman/tog_with_cukes and I think that admin_data doesn't load the models specified in plugins. Could be posible to add these models to admin_data interface?

Thanks in advance

show the real count of records deleted and destroyed

User.delete_all returns the count of records destroyed. Use that value to return the count of records deleted.

Similarly user.destroy does not mean user is destroyed. keep track of records actually destroyed and then report it.

Serialized arrays

I am currently using a serialized array which is stored as a string in the database to handle roles in my user model. Unfortunately though, admin_data tries to call mb_chars on that Array object.

Errors follow:

Showing vendor/plugins/admin_data/app/views/admin_data/main/list.html.erb where line #33 raised:

undefined method `mb_chars' for ["admin"]:Array

Extracted source (around line #33):

30: 
31:         
32:
33: <%= erb_file('search','_search_results.html.erb') %> 34:
35:
36:

misc typo fix

in app/views/admin_data/main/misc/_modify_record.html.erb

"You are deleing (not destorying) a record. Are you sure?"

should be

"You are deleting (not destroying) a record. Are you sure?"

Main page has select box with same id

cucumber needs an id on select box to be able to select an item. However adding that id makes two same id on the main html page which is invalid. Fix it.

working with HABTM models

I'd like to see the ability to work with has and belongs to many models. A multiselect list or add/remove interface or something like that.

Hide certain columns

You should be able to exclude certain columns from the view, both in the listing and the detail page of a record.

Many apps/models have columns which aren't at all useful outside of the code, like crypted_password, salt, etc.

raise errors when rake db:create

$ rake db:create --trace

error messages:
...............
/home/zhaorong/NetBeansProjects/clubchloe/vendor/plugins/admin_data/lib/admin_data/settings.rb:26:in set=' /home/zhaorong/NetBeansProjects/clubchloe/vendor/plugins/admin_data/lib/admin_data/settings.rb:30:ininitialize_defaults'
/home/zhaorong/NetBeansProjects/clubchloe/vendor/plugins/admin_data/init.rb:43:in `evaluate_init_rb'
..............

    If I remove admin_data plugin, rake db:create command is works.

Rails 3

Hey, do you plan to support rails 3? Your plugin is awesome by the way!

Problem with advance search, fails with NZKoz-rails_xss plugin

When I use the advance search feature I always get the following error. Rendering /home/family/Desktop/old/final2/vendor/plugins/admin_data/app/views/admin_data/search/search/_listing.html.erb

ArgumentError (wrong number of arguments (1 for 2)):
vendor/plugins/admin_data/app/controllers/admin_data/search_controller.rb:55:in advance_search' vendor/plugins/admin_data/app/controllers/admin_data/search_controller.rb:44:inadvance_search

I using rails 2.3.5.

Also, i noticed that this plugin will not work with the new rails_xss plugin

Ability to execute custom advance search

Assume Comment model has a column called approved.

It is a common need to see all the comments which are waiting for approval. Rather than running the query and presenting the list in controller, this plugin could be used for these types of reports.

Plugin should accept an advance search name and all the parameters necessary to construct an advance search. On the advance search page, list of advance search names should appear.

handling large has_one associations

We have a production app on which we want to use admin_data, but running into a problem.. The tables are medium-sized (30-50K rows), and when we hit "create record", admin_data is trying to create a dropdown with all of those users, which results in 50s load times + a very heavy page that freezes anytime you touch that dropdown. ;-)

Not sure how to handle this, but intuitively, 30-50k rows is not that big, and I think there should be some way to override the settings and not generate that drop down (i'm perfectly ok with a simple input box). Perhaps there is a better way to handle this?

Routing Error on Delete

Hi I'm having trouble using the delete (and destroy) actions on my models. I get the following error:

Routing Error

No route matches "/admin_data/klass/xxxx/7/del"

Where xxxx is the model class name and 7 is the ID.

I'm running Rails 3.0.0.

Any suggestions?

Error when using with Devise

I'm on Rails 3 and using Devise for authentication.

I've installed admin_data as per the install instructions but when I browse /admin_data I get this error:

  Started GET "/admin_data" for x.x.x.x at Fri Oct 22 16:03:54 +0100 2010
Processing by AdminData::MainController#all_models as HTML
 Rendered text template (0.0ms)
 Completed 401 Unauthorized in 12ms (Views: 1.3ms | ActiveRecord: 1.7ms)

   NoMethodError (undefined method `new__session_path' for #<Devise::FailureApp:0x2aaab49be0b8>):

In an attempt to workaround this I have temporarily used:

  AdminData::Config.set = {
    :is_allowed_to_view => true,
    :is_allowed_to_update =>true
 }

but even so it croaks with the above. I assume this is something to do with a form that admin_data is trying to render, which is trying to used a named route URL, but I am not sure how to fix it.

Thanks.

Support for Paperclip attachments

It would be great to include support for displaying Paperclip attachments within the interface. Some sort of funcitonality to include the thumbnail, which you can specify in the configuration.

Great plugin!

Can't edit / delete records on models with custom set_primary_key

Hey guys, love the plugin. Just dropped it into one of my projects and it looks like any model that overrides the primary key (have a hash key for example, instead of straight up ID), the key is not linked from the list view, or from anywhere else for that matter.

(hope I'm not doing something silly).

ig

How To Handle Model In Module?

Excellent plugin! It works great for all of my models except those that are namespaced inside modules. For example:

class Email::Message < ActiveRecord::Base
self.table_name="email_messages"
belongs_to :user, :class_name => "User"
end

When I attempt to access records in this model via the admin interface, I see the following in my server logs:

Processing AdminData::MainController#list (for 127.0.0.1 at 2009-08-26 22:10:45) [GET]
Parameters: {"klass"=>"Email::Message", "action"=>"list", "controller"=>"admin_data/main"}
Redirected to http://localhost:3000/admin_data
Filter chain halted as [:get_class_from_params] rendered_or_redirected.
Completed in 2ms (DB: 0) | 302 Found [http://localhost/admin_data/list?klass=Email%3A%3AMessage]
controller_name is main

And ideas?

Works on some models but not others

Hi, I installed admin_data and it works well on most of my models, but on a few it simply throws errors when I select them. For example, when I select one of the problem models, it returns this error message:

 ActionController::RoutingError in Admin_data/search#search

Showing vendor/plugins/admin_data/app/views/admin_data/search/search/_listing.html.erb where line #25 raised:

admin_data_on_k_url failed to generate from {:action=>"show", :controller=>"admin_data/main", :id=>#, :klass=>"category"}, expected: {:controller=>"admin_data/main", :action=>"show"}, diff: {:id=>#, :klass=>"category"}

Extracted source (around line #25):

22:         
23:           <% if (column.name == klass.primary_key) %>
24:             <%= link_to(record.send(column.name), 
25:                       admin_data_on_k_path(:klass => klass.name.underscore, :id => record)) %>
26:           <% else %>
27:             <%=h  admin_data_get_value_for_column(column,record) %>
28:           <% end %>  

I'm not really sure why it works on some but not others, but any help or advice is appreciated. I can provide more details if needed.

Allow user to update records in mass after searching the record

Let's say that I searched and got 100 records in result. I would like to change the status of all these records to 'done'. Allow something like this

model.status = 'done'

The code should yield model to the user input. And user will have access to 'model' and user can do anything user wants. At the end of yielding model.save will be called. If there are any errors then they will be reported.

Advanced Search

Click on condition after selecting a boolean column, results in a JS exception

From firebug -

AdminDataJSUtil.column_options[col1_type] is undefined
[Break on this error] var options = AdminDataJSUtil.column_options[col1_type]['options'];\n

There is no exception if the boolean column is selected as a second row. But it shows no conditions in the conditions drop down.

Other column types work. This is on postgres, just in case it matters.

ruby 1.9.1 compatibility

When using ruby 1.9.1 if a table has data in it I get the following error message.

Showing vendor/plugins/admin_data/app/views/admin_data/search/search/_listing.html.erb where line #31 raised:

undefined method `name' for nil:NilClass

This works fine when the table is empty.

Patch to allows update of protected attributes

Hello,

Currently admin_data does not update protected attributes. However I find useful to be able to update also protected attributes in the admin area. Here is a patch to permit the update of protected attributes:
http://gist.github.com/254595

I tested by hand on my application, and the patch works, protected attributes can be updated.

Unfortunately the test I wrote does not work:
should_change "@article.status", :from => 'published', :to => 'something'
I am not sure why, as I usually do not use shoulda, but any help/indication/suggestion would be welcome so that I can fix the test :)

And thanks for the plugin, it is very useful!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.