working with edge rails 9248

7 views
Skip to first unread message

nonrec...@gmail.com

unread,
Apr 27, 2008, 4:22:24 PM4/27/08
to ActiveScaffold : Ruby on Rails plugin
Hello all,

I had a hell of a time getting this working with edge rails r9248. My
patch is applied on top of acechase's (http://code.google.com/p/
activescaffold/issues/detail?id=515)

Apparently google doesn't have a field for attaching patches so here's
a pastie:
http://pastie.caboo.se/187712

Daniel

p.s. This code is getting pretty gnarly

nonrec...@gmail.com

unread,
Apr 27, 2008, 4:32:11 PM4/27/08
to ActiveScaffold : Ruby on Rails plugin
p.p.s Evidently the easiest way to get active scaffold routes working
is to just rely on ol' map.connect ':controller/:action/:id'

On Apr 27, 4:22 pm, "nonrecurs...@gmail.com" <nonrecurs...@gmail.com>
wrote:

acechase

unread,
Apr 29, 2008, 1:54:45 PM4/29/08
to ActiveScaffold : Ruby on Rails plugin
Daniel,

I like what you've done here. Your partial_pieces modification seems
to be a lot cleaner than my initial hack. I've just updated to edge
rails yet again, from r8804 to edge rails via git on 4/28 (git's cool
and all, but damn, I'm already missing regularly incrementing revision
numbers). And sure enough, my AS code is broken again. Hopefully
applying your patch will get me back up and running again.

Fundamentally, I think the code will continue to be gnarly and hackish
until AS is updated to work with the refactorings made with in the
rails rendering components. Yes? Anyone?... Bueller?

cheers,
Andrew

On Apr 27, 1:22 pm, "nonrecurs...@gmail.com" <nonrecurs...@gmail.com>
wrote:

acechase

unread,
Apr 29, 2008, 11:42:17 PM4/29/08
to ActiveScaffold : Ruby on Rails plugin
Hmm... I'm beginning to think there should be a persistent wiki page:
WorkingWithEdgeRails. A single place to store all the hacks needed to
get AS working on edge rails. Thoughts?

There were a couple additional changes I needed to make on top of
Daniels patch to get edge rails (as of 20080429) working:
http://pastie.caboo.se/189094 (sorry, I'm managing my AS plugin via
piston so the revision numbers won't tie in).

One change I made, in action_view_rendering, looks like it was just
left out of Daniels earlier pastie (I'm guessing he meant to include
it). The other change, in generic_view_paths, is pretty simple, but
needs to be made because the number of arguments to that aliased
method have changed on rails trunk.

Daniel, after looking at your code, one question I had for you is with
regards to your comment about #partial_pieces no longer existing in
rails. When I checked, I see that method exists here:
rails/actionpack/lib/action_view/partial_template.rb
Was that method not available when you made your patch? Or perhaps the
rails team has changed the functionality enough that it no longer
works for AS? Maybe you just missed it? Some other reason?

Sadly, I probably won't be looking into this again until I need to
update my version of rails again :-\. I still think AS is a great
project and I hope that it continues to stay up to date with the
newest versions of rails. I'll be keeping tabs on these forums and am
hopeful that all this edge stuff will get straightened out soon...

Cheers,
Andrew

nonrec...@gmail.com

unread,
Apr 30, 2008, 8:27:58 AM4/30/08
to ActiveScaffold : Ruby on Rails plugin
Thanks Andrew :)

I'm also still having a little trouble, so I'll probably be cooking up
another patch on top of yours. Is there an easy way to combine
patches? The only thing that I can think of is just to do an svn diff
between an unpatched revision and the latest revision.

I'm also using record select. I'm still having trouble with it, but I
at least got the record_select browse partial to render with ajax
calls:
http://pastie.caboo.se/189238
You'll also need to move the files in record_select/lib/views to
record_select/lib/views/record_select

In doing the above I found the ActionController::Base#append_view_path
method. I was able to really understand the new view finding code by
reading rails/actionpack/lib/action_view/template_finder , especially
between lines 23 and 40. It's likely we can use
ActionController::Base#append_view_path to more cleanly fix the AS
view problems.

I agree that it would make sense to have a wiki page.

Re: #partial_pieces - I did later find the method, and that they had
moved it. They also changed its signature so that it takes a view
object, so it's not compatible with the old partial_pieces method.

Thanks again!
Daniel

thoraxe

unread,
May 16, 2008, 2:15:18 PM5/16/08
to ActiveScaffold : Ruby on Rails plugin
Could someone perhaps post a complete patch with instructions? I have
a feeling that me trying to dig through all of this might break
something.

From what I can tell it looks like I need to apply the issues in #515,
then:
http://pastie.caboo.se/189094

Then:
http://pastie.caboo.se/189238

And move the files in record_select/lib/views to record_select/lib/
views/record_select

Is this complete?

-Erik

Andrew Selder

unread,
May 21, 2008, 3:10:44 PM5/21/08
to ActiveScaffold : Ruby on Rails plugin
Just a heads up for everyone.

If you try and use the patch(s) described, you will get AS running
with Rails 2.1 (at least I did). However the
active_scaffold_acts_as_list plugin is incompatible.

The rewrite_template_path_for_active_scaffold blows up (lib/extensions/
action_controller_rendering.rb, lines 41-60). It looks like the
active_scaffold_act_as_list directory gets added to the template
search path. The Dir.entries call on line 55 then searches that
directory and returns nil, which then causes the template_exists? to
blow up.

Easy fix:
Add "next unless template_file" after line 53.

That at least lets the list action display. More updates as I work
through this.

Andrew

MattJones

unread,
May 21, 2008, 8:53:48 PM5/21/08
to ActiveScaffold : Ruby on Rails plugin
I'm working on migrating my project over to git and rails 2.1 RC1 at
the same time.

I've installed activescaffold using

git submodule add git://github.com/activescaffold/active_scaffold.git
vendor/plugins/active_scaffold

What I'm wondering is, is/should there be a branch within this
active_scaffold git repository for rails 2.1 with all these patches?

Thanks,

Matt

MattJones

unread,
May 21, 2008, 10:28:03 PM5/21/08
to ActiveScaffold : Ruby on Rails plugin
At the least, here is a pastie of a combined diff that got me going
again....Hope this helps somebody else too!

http://pastie.caboo.se/201324


combine patches from http://code.google.com/p/activescaffold/issues/detail?id=515
and http://pastie.caboo.se/189094, never got the patchfile from
http://pastie.caboo.se/189238 to work, and haven't seen that it is
necessary yet.

robd

unread,
Jun 1, 2008, 11:21:56 AM6/1/08
to ActiveScaffold : Ruby on Rails plugin
Having applied your patch I also had to check for template_file being
nil since I had view extensions in active_scaffold_overrides.


Before I did that that I got the following errors:

You have a nil object when you didn't expect it!
The error occurred while evaluating nil.sub

/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/
template_finder.rb:108:in `file_exists?'
/opt/local/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/
action_controller/base.rb:1235:in `template_exists?'
/vendor/plugins/active_scaffold/lib/extensions/
action_controller_rendering.rb:53:in
`rewrite_template_path_for_active_scaffold'

Rob

On May 22, 3:28 am, MattJones <mattjonesph...@gmail.com> wrote:
> At the least, here is a pastie of a combined diff that got me going
> again....Hope this helps somebody else too!
>
> http://pastie.caboo.se/201324
>
> combine patches fromhttp://code.google.com/p/activescaffold/issues/detail?id=515
> andhttp://pastie.caboo.se/189094, never got the patchfile fromhttp://pastie.caboo.se/189238to work, and haven't seen that it is
> necessary yet.
Reply all
Reply to author
Forward
0 new messages