rails 3.1

72 views
Skip to first unread message

Sergio Cambra .:: entreCables S.L. ::.

unread,
Sep 15, 2011, 6:35:15 AM9/15/11
to ActiveScaffold : Ruby on Rails plugin
3.1.0 version supporting rails 3.1 has been released:
http://activescaffold.com/2011/9/15/rails-3-1-support

I haven't tested render_component in rails 3.1 so loading embedded scaffolds by
AJAX is the default and recommended way now.

I think all features are working, but I haven't tested it intensively. I will
be testing it with an application I'm developing now with active_scaffold

--
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com

Nick Rogers

unread,
Sep 15, 2011, 6:42:15 PM9/15/11
to actives...@googlegroups.com
Great news!

Is this still the way to render embedded scaffolds, except without the render_component plugin? Or is there another way?

<%= render :active_scaffold => 'teams' %>


Thanks!


--
You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to actives...@googlegroups.com.
To unsubscribe from this group, send email to activescaffol...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en.


Atastor

unread,
Sep 16, 2011, 3:27:57 AM9/16/11
to actives...@googlegroups.com
Fantastic (Nick stole the "Great News" from me :-( )!

How does the "Add require active_scaffold to your assets pipeline." work? Leaving this part out only produces not layouted pages, naively adding 

//= require_active_scaffold

and

 *= require_active_scaffold

in app/assets/application.js and app/assets/application.css respectively produces the error message

couldn't find file 'active_scaffold

I am quite sure, its me again, but I can't figure it out. Any hints?

Regards
Michael
 

Sergio Cambra .:: entreCables S.L. ::.

unread,
Sep 16, 2011, 4:22:57 AM9/16/11
to actives...@googlegroups.com
On Viernes, 16 de Septiembre de 2011 00:42:15 Nick Rogers escribió:
> Great news!
>
> Is this still the way to render embedded scaffolds, except without the
> render_component plugin? Or is there another way?
>
> <%= render :active_scaffold => 'teams' %>
>

Yes, that's the way. It works without render_component, like in 3.0 version.
It will work with render_component, if render_component works with rails 3.1,
I haven't tried it.

Sergio Cambra .:: entreCables S.L. ::.

unread,
Sep 16, 2011, 4:23:59 AM9/16/11
to actives...@googlegroups.com

It's working with that lines for me. Have you trying in a new app? Are you
using it as gem or plugin?

Atastor

unread,
Sep 16, 2011, 4:33:36 AM9/16/11
to actives...@googlegroups.com
I am using the gem and retried with new, most simple app (active_scaffolded 1 class with 1 attribute), the error message remains.





Sergio Cambra .:: entreCables S.L. ::.

unread,
Sep 16, 2011, 5:40:39 AM9/16/11
to actives...@googlegroups.com
On Viernes, 16 de Septiembre de 2011 10:33:36 Atastor escribió:
> I am using the gem and retried with new, most simple app (active_scaffolded
> 1 class with 1 attribute), the error message remains.

It's strange, it was working yesterday, but now it's failing in app I was
developing too

Sergio Cambra .:: entreCables S.L. ::.

unread,
Sep 16, 2011, 6:16:13 AM9/16/11
to actives...@googlegroups.com
On Viernes, 16 de Septiembre de 2011 11:40:39 Sergio Cambra .:: entreCables
S.L. ::. escribió:

> On Viernes, 16 de Septiembre de 2011 10:33:36 Atastor escribió:
> > I am using the gem and retried with new, most simple app
> > (active_scaffolded 1 class with 1 attribute), the error message remains.
>
> It's strange, it was working yesterday, but now it's failing in app I was
> developing too

It was working when I used gem as path, I forgot to add assets to gem

Install 3.1.1

Atastor

unread,
Sep 16, 2011, 7:17:22 AM9/16/11
to actives...@googlegroups.com
The error is gone, thanks!

Next problem, both with 3.1.1 and with 3.1.2: "Search" and "Create New" are not functional, clicking them results in nothing. Checking with Chrome-Debugger shows the following problem:


Atastor

unread,
Sep 16, 2011, 7:48:32 AM9/16/11
to actives...@googlegroups.com
Played around with the order of the require statements; setting the require active_scaffold to the last position instead of the first position (which indeed might have been a bit silly), shows a different error:

No further error messages are visible in development.log:

Started GET "/results/new?adapter=_list_inline_adapter" for 127.0.0.1 at 2011-09-16 13:45:47 +0200
  Processing by ResultsController#new as JS
  Parameters: {"adapter"=>"_list_inline_adapter"}
Rendered /Users/michaelp/.rvm/gems/ruby-1.9.2-p290@rails-3_1/gems/active_scaffold-3.1.2/frontends/default/views/_form_attribute.html.erb (1.1ms)
Rendered /Users/michaelp/.rvm/gems/ruby-1.9.2-p290@rails-3_1/gems/active_scaffold-3.1.2/frontends/default/views/_form.html.erb (5.8ms)
Rendered /Users/michaelp/.rvm/gems/ruby-1.9.2-p290@rails-3_1/gems/active_scaffold-3.1.2/frontends/default/views/_base_form.html.erb (11.6ms)
Rendered /Users/michaelp/.rvm/gems/ruby-1.9.2-p290@rails-3_1/gems/active_scaffold-3.1.2/frontends/default/views/_create_form.html.erb (15.5ms)
Rendered /Users/michaelp/.rvm/gems/ruby-1.9.2-p290@rails-3_1/gems/active_scaffold-3.1.2/frontends/default/views/_messages.html.erb (0.6ms)
Rendered /Users/michaelp/.rvm/gems/ruby-1.9.2-p290@rails-3_1/gems/active_scaffold-3.1.2/frontends/default/views/_list_inline_adapter.html.erb (5.0ms)
Completed 200 OK in 29ms (Views: 7.9ms | ActiveRecord: 0.0ms)

Started GET "/results/new?adapter=_list_inline_adapter" for 127.0.0.1 at 2011-09-16 13:45:47 +0200
  Processing by ResultsController#new as JS
  Parameters: {"adapter"=>"_list_inline_adapter"}
Rendered /Users/michaelp/.rvm/gems/ruby-1.9.2-p290@rails-3_1/gems/active_scaffold-3.1.2/frontends/default/views/_form_attribute.html.erb (1.1ms)
Rendered /Users/michaelp/.rvm/gems/ruby-1.9.2-p290@rails-3_1/gems/active_scaffold-3.1.2/frontends/default/views/_form.html.erb (6.1ms)
Rendered /Users/michaelp/.rvm/gems/ruby-1.9.2-p290@rails-3_1/gems/active_scaffold-3.1.2/frontends/default/views/_base_form.html.erb (12.4ms)
Rendered /Users/michaelp/.rvm/gems/ruby-1.9.2-p290@rails-3_1/gems/active_scaffold-3.1.2/frontends/default/views/_create_form.html.erb (16.1ms)
Rendered /Users/michaelp/.rvm/gems/ruby-1.9.2-p290@rails-3_1/gems/active_scaffold-3.1.2/frontends/default/views/_messages.html.erb (0.5ms)
Rendered /Users/michaelp/.rvm/gems/ruby-1.9.2-p290@rails-3_1/gems/active_scaffold-3.1.2/frontends/default/views/_list_inline_adapter.html.erb (6.2ms)
Completed 200 OK in 33ms (Views: 11.4ms | ActiveRecord: 0.0ms)

Atastor

unread,
Sep 16, 2011, 7:52:46 AM9/16/11
to actives...@googlegroups.com
Deactivating javascript helps, btw, so it is for sure something about the javascript pipeline, I ld say.

Ed Jones

unread,
Sep 16, 2011, 9:24:36 AM9/16/11
to ActiveScaffold : Ruby on Rails plugin
Tried upgrading my app from 3.0

Got this from bundle update rails
Bundler could not find compatible versions for gem "rails":
In Gemfile:
active_scaffold depends on
rails (~> 3.0.0)

rails (3.1.0)

gem update active_scaffold and gem update rails seemed to work fine.

but running the server or rspec gives
You have requested:
rails = 3.1

The bundle currently has rails locked at 3.0.9.
Try running `bundle update rails`

Thanks,
ed

On Sep 15, 6:35 am, "Sergio Cambra .:: entreCables S.L. ::."

Sergio Cambra .:: entreCables S.L. ::.

unread,
Sep 16, 2011, 9:42:23 AM9/16/11
to actives...@googlegroups.com
Try with bundle update rails active_scaffold

Sergio Cambra .:: entreCables S.L. ::.

unread,
Sep 16, 2011, 9:46:01 AM9/16/11
to actives...@googlegroups.com
On Viernes, 16 de Septiembre de 2011 13:52:46 Atastor escribió:
> Deactivating javascript helps, btw, so it is for sure something about the
> javascript pipeline, I ld say.

require active_scaffold must be under *_ujs or javascript won't work,
ActiveScaffold uses Jquery or Prototype and must be loaded after.

I have tried it now, and opening search displays failed request. Response
content is ok, but content type is javascript instead of text/html.

Ed Jones

unread,
Sep 16, 2011, 9:51:46 AM9/16/11
to ActiveScaffold : Ruby on Rails plugin
> Try with bundle update rails active_scaffold

Bundler could not find compatible versions for gem "bcrypt-ruby":
In Gemfile:
rails (= 3.1) depends on
bcrypt-ruby (~> 3.0.0)

bcrypt-ruby (2.1.4)

this could get to be a very long bundle update command! :~)


On Sep 16, 9:42 am, "Sergio Cambra .:: entreCables S.L. ::."

Ed Jones

unread,
Sep 16, 2011, 10:14:14 AM9/16/11
to ActiveScaffold : Ruby on Rails plugin
OK, i ran gem update --system, then updates all my gems, then forced
bcrypt, then ran your bundle update rails active_scaffold

and now have a railtie error which doesn't seem to involve
active_scaffold.

Thanks!

ed

Sergio Cambra .:: entreCables S.L. ::.

unread,
Sep 16, 2011, 11:31:08 AM9/16/11
to actives...@googlegroups.com
On Viernes, 16 de Septiembre de 2011 13:52:46 Atastor escribió:
> Deactivating javascript helps, btw, so it is for sure something about the
> javascript pipeline, I ld say.

Try it now. I haven't released a new version, you should use :git => '...'
option in your Gemfile

cpg

unread,
Sep 17, 2011, 4:22:09 PM9/17/11
to ActiveScaffold : Ruby on Rails plugin
Hi,

Great job on the 3.1 release!

I am a bit lost when it comes to embedded scaffolds. I have an app
that is working fine in 3.0.9 and am not sure what exactly i have to
do bring it to 3.1.

The AS table comes up, but things inside do not work. Search, create,
and things like the Edit action link. They do send a request to the
server, seemingly in JS

Processing by Admin::UsersController#edit as JS

But it sits there with the indicator spinning and nothing coming back
to the UI.

I removed vendor/plugins/render_component, based on the comments in
this thread. I still have dynamic_form and verification.

Basically I am a little confused on how to move this to the new asset
pipeline.

I am using the gem (active_scaffold-3.1.2).

Keep up the great work and remember that we have an IRC channel now
for sharing tips about ActiveScaffold. #active-scaffold in freenode.

Thanks in advance!

Carlos

On Sep 16, 1:22 am, "Sergio Cambra .:: entreCables S.L. ::."

cpg

unread,
Sep 18, 2011, 6:12:28 AM9/18/11
to ActiveScaffold : Ruby on Rails plugin
Scratch that, I apologize. I got now what embedded scaffolds are.

The problem I have seems unrelated to embedded scaffolds.

The issue is that ajax calls, like in things such as search or create
actions, do not work at all. The call is made, but nothing seems to
come back.

Thanks again,

-c

Sergio Cambra .:: entreCables S.L. ::.

unread,
Sep 19, 2011, 3:31:16 AM9/19/11
to actives...@googlegroups.com
On Sábado, 17 de Septiembre de 2011 22:22:09 cpg escribió:
> Hi,
>
> Great job on the 3.1 release!
>
> I am a bit lost when it comes to embedded scaffolds. I have an app
> that is working fine in 3.0.9 and am not sure what exactly i have to
> do bring it to 3.1.

About embedded scaffolds you don't need to do anything. Without
render_component embedded scaffolds will be loaded by AJAX and you will finish
with same view.

>
> The AS table comes up, but things inside do not work. Search, create,
> and things like the Edit action link. They do send a request to the
> server, seemingly in JS
>
> Processing by Admin::UsersController#edit as JS
>
> But it sits there with the indicator spinning and nothing coming back
> to the UI.
>
> I removed vendor/plugins/render_component, based on the comments in
> this thread. I still have dynamic_form and verification.

Dynamic_form have never been used by ActiveScaffold, if you use it it's ok.
Verification is not used, but it's unharmful.

>
> Basically I am a little confused on how to move this to the new asset
> pipeline.

If you are updating an old app, follow this tip:
http://blog.nodeta.com/2011/06/14/rails-3-1-asset-pipeline-in-the-real-world/

uglifier is not needed

For example, in app/assets/stylesheets/application.css put
/*
*= require active_scaffold
*= require_self
*/
your styles


If you have some background images, you should use application.css.erb and use
image_path or image_url:
/*
*= require active_scaffold
*= require_self
*/
your styles {
background-image: url(<%= image_path 'image.png' %>);
background-image: <%= image_url 'image.png' %>;
}

You can divide your styles in multiple files and require them in
application.css

For javascript, use this:
//= require jquery
//= require jquery_ujs
//= require active_scaffold
//= require_self

Your javascript code here


And in your layout include only application.css and application.js:

<%= stylesheet_link_tag 'application' %>
<%= javascript_include_tag 'application' %>

>
> I am using the gem (active_scaffold-3.1.2).

I think JS is working in master branch, I will release it when someone confirms
it or when I have more time to test it.

cpg

unread,
Sep 19, 2011, 3:29:14 PM9/19/11
to ActiveScaffold : Ruby on Rails plugin
Thank you for the detailed explanation, Sergio. I have all the assets
(seemingly) well now.

It looks like I was including the AS JS assets in duplicate and that
seems to cause the trouble.

It also looks like using master (with gem 'active_scaffold', :git =>
'https://github.com/activescaffold/active_scaffold.git') is also
required to get JS working.

With that, things generally work. There are a few little things that
seem different. Like when a search is done, the search button is
disabled. Pressing <enter> seems to work, tho, so it's not a huge
deal.

http://dl.dropbox.com/u/364883/Screenshots/lrbw.png

Great job and let us know if you release master into a release proper,
as that's more stable for production than using master.

Thanks!

cpg

unread,
Sep 19, 2011, 5:25:14 PM9/19/11
to ActiveScaffold : Ruby on Rails plugin

Sergio Cambra .:: entreCables S.L. ::.

unread,
Sep 20, 2011, 5:19:41 AM9/20/11
to actives...@googlegroups.com

I'm waiting to ensure it's working. I don't want to release a version for each
bug I fix

Reply all
Reply to author
Forward
0 new messages