Em 16-09-2013 19:33, Jeremy Evans escreveu:
On Monday, September 16, 2013 2:49:48 PM UTC-7, Rodrigo Rosenfeld
Rosas wrote:
Em 16-09-2013 17:02, Jeremy Evans escreveu:
On Monday, September 16, 2013 12:14:14 PM UTC-7, Rodrigo
Rosenfeld Rosas wrote:
Something like rails_admin, for instance, but with Sequel
support...
There's scaffolding_extensions
(https://github.com/jeremyevans/scaffolding_extensions/
<https://github.com/jeremyevans/scaffolding_extensions/>), and
I'm working on a replacement that will use forme
(https://github.com/jeremyevans/forme/
<https://github.com/jeremyevans/forme/>) as the form generator,
but it's not ready yet.
There are probably integration gems allowing Sequel to be used
with admin interfaces initially designed for ActiveRecord, but I
don't have experience with them.
Thank you, Jeremy. I've previously tried my own search for admin
UI's without success...
Then I had a hard time trying to setup your scaffolding_extensions
in my Rails app. After digging a lot in the source, I found out
that I should add the gem to the Gemfile, create a new controller,
add the generic routes to it, and add something like this to it:
Yes, you need to add the gem to the Gemfile (or just require it if you
aren't using bundler).
You don't need to have a new controller for it, it will work with an
existing controller. You do need to have a generic route (it was
designed pre-Rails 1.0), as documented in doc/rails.txt.
layout false # this is required for picking the layout provided
by the gem
In most cases, you'll want to use your existing layout, not the one
provided by the gem.
#scaffold User # I've tried this for a long time until I
realized it doesn't generate an index page
scaffold_all_models only: [User]
That's expected.
After that, I could get a basic version working, but I feel
there's something missing as it seems to be supposed to use jQuery
tabs, autocomplete and other components while the provided layout
doesn't include jQuery, but only a CSS reference to bootstrap,
which isn't even bundled by the gem it seems...
It offers bootstrap integration, and doesn't look good without
bootstrap, though it is still functional (the README mentions this).
It doesn't require anything else for basic features. If you want to
enable some dynamic features such autocompletion, it supports both
JQuery (see contrib/scaffold_jquery_autocomplete) and Prototype.
So, I believe it's not supposed to work out of the box without
spending some time creating a proper layout to support it, but I
couldn't find any instructions on what should be contained in such
layout...
Well, if you add the generic route, it should work out of the box for
simple features. It may not look good, but it should work.
It would help if you could provide some simple instructions on how
to set it up in a Rails project.
Well, like I said, I'm working on a replacement. I don't plan to work
much on it in the future. The README, doc/* files, and RDoc are
basically all the documentation there is. I'll certainly consider
patches to improve the documentation, and if you have specific
questions I can probably answer them.
Thanks,
Jeremy
Thank you, Jeremy. I could set up a custom template for it (our project
doesn't use bootstrap) and it's looking good now.
I could use something like this to filter some users that won't be
managed by the admin ui:
def self.scaffold_session_conditions(session)
"not (#{scaffold_table_name}.username like '%@integration_imported%')"
end
Now, something that would be helpful is the ability of showing the roles
in the list action. The model has something like this:
many_to_many :roles, join_table: :user_roles
I can edit the associations, and that works fine. But it would be
extremely useful if I could list them in the index page as well as being
able to filter by role in the Search tab.
I'm a bit lost on how to allow that. Could you please help me?
Best,
Rodrigo.
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/groups/opt_out.