Rails 3

43 views
Skip to first unread message

Miranda Cardinal

unread,
Dec 1, 2010, 11:41:42 PM12/1/10
to restfulx-framework
I would like to use restfulx on a rails 3 project, but it seems as
though it only supports rails 2.x. Has anyone managed to get restfulx
working with rails 3? If not are there any plans to update the
framework for rails 3?

Dima Berastau

unread,
Dec 2, 2010, 8:05:00 PM12/2/10
to restfulx-...@googlegroups.com
Hi Miranda,

I've been very busy with client projects so haven't had the time to port restfulx gem to Rails 3 yet, but it's on the agenda.

Speaking of which. If anyone wants to help with Rails 3 port feel free to jump in. Just fork the project on github. I am always happy to pull additions other people find useful provided they don't break existing functionality.

Dima

> --
> You received this message because you are subscribed to the Google Groups "restfulx-framework" group.
> To post to this group, send email to restfulx-...@googlegroups.com.
> To unsubscribe from this group, send email to restfulx-framew...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/restfulx-framework?hl=en.
>

William P Voll

unread,
Dec 2, 2010, 8:38:46 PM12/2/10
to restfulx-...@googlegroups.com
Hi Dima,

Is there a list of what needs to be done, I would like to help as I am
in the same boat as Miranda.


Bill

--
William

scho

unread,
Dec 3, 2010, 5:50:26 AM12/3/10
to restfulx-framework
Hi Dima,

I'm porting our application to Rails 3 too. And since we use RestfulX
I've started to port some functionality of RestfulX to Rails 3.
I don't really need all the generators, the most important thing for
me is the to_fxml function for active_record instances, errors and
arrays.

First I've taken a look at the implementation of the RestfulX
serialization. I've seen, that you've copied most of the code of the
Xml serializer and then you've made your changes. So you don't
actually use any of the xml stuff already programmed in rails. Do I
get this right or am I wrong?

So, what I've done is the following:
I was digging into the Rails 3 source code until I found the classes,
which implement the to_xml stuff. These classes are:
* rails / activerecord / lib / active_record / serializers /
xml_serializer.rb (https://gist.github.com/rails/rails/blob/master/
activerecord/lib/active_record/serializers/xml_serializer.rb)
* rails / activesupport / lib / active_support / core_ext / array /
conversions.rb (https://github.com/rails/rails/blob/master/
activesupport/lib/active_support/core_ext/array/conversions.rb)
* rails / activemodel / lib / active_model / errors.rb (https://
gist.github.com/rails/rails/blob/master/activemodel/lib/active_model/
errors.rb)
* rails / activemodel / lib / active_model / serializers / xml.rb
(https://gist.github.com/rails/rails/blob/master/activemodel/lib/
active_model/serializers/xml.rb)

Then I've built the same class structure I found in Rails 3 in
RestfulX (except, that all is in a module called RestfulX), changed
to_xml to to_fxml and made the same modifications you did. Finally
I've thrown all the unused stuff away.

So, what do you think? Am I on the right track?

Another thing, theres is a rails3 branch in your project. Am I
supposed to take that one or the master branch?

Cheers,

Georg

On 3 Dez., 02:38, William P Voll <wpv...@gmail.com> wrote:
> Hi Dima,
>
> Is there a list of what needs to be done, I would like to help as I am
> in the same boat as Miranda.
>
> Bill
>
>
>
> On Thu, Dec 2, 2010 at 8:05 PM, Dima Berastau <dima.beras...@gmail.com> wrote:
> > Hi Miranda,
>
> > I've been very busy with client projects so haven't had the time to port restfulx gem to Rails 3 yet, but it's on the agenda.
>
> > Speaking of which. If anyone wants to help with Rails 3 port feel free to jump in. Just fork the project on github. I am always happy to pull additions other people find useful provided they don't break existing functionality.
>
> > Dima
>
> > On 2010-12-01, at 8:41 PM, Miranda Cardinal wrote:
>
> >> I would like to use restfulx on a rails 3 project, but it seems as
> >> though it only supports rails 2.x.  Has anyone managed to get restfulx
> >> working with rails 3?  If not are there any plans to update the
> >> framework for rails 3?
>
> >> --
> >> You received this message because you are subscribed to the Google Groups "restfulx-framework" group.
> >> To post to this group, send email to restfulx-...@googlegroups.com.
> >> To unsubscribe from this group, send email to restfulx-framew...@googlegroups.com.
> >> For more options, visit this group athttp://groups.google.com/group/restfulx-framework?hl=en.

Dima Berastau

unread,
Dec 7, 2010, 1:20:10 PM12/7/10
to restfulx-...@googlegroups.com
Hi Georg,

Definitely looks like you are in the right track. I am assuming someone else (or I) can look at the generators when there's time.

Further comments are inline.

On 2010-12-03, at 2:50 AM, scho wrote:

> Hi Dima,
>
> I'm porting our application to Rails 3 too. And since we use RestfulX
> I've started to port some functionality of RestfulX to Rails 3.
> I don't really need all the generators, the most important thing for
> me is the to_fxml function for active_record instances, errors and
> arrays.
>
> First I've taken a look at the implementation of the RestfulX
> serialization. I've seen, that you've copied most of the code of the
> Xml serializer and then you've made your changes. So you don't
> actually use any of the xml stuff already programmed in rails. Do I
> get this right or am I wrong?

It was easier to customize to_fxml stuff by mirroring what was done in Rails for serialization rather then delegating to it, so FXMLSerializer is pretty much standalone but is explicitly based on Rails XMLSerializer.

>
> So, what I've done is the following:
> I was digging into the Rails 3 source code until I found the classes,
> which implement the to_xml stuff. These classes are:
> * rails / activerecord / lib / active_record / serializers /
> xml_serializer.rb (https://gist.github.com/rails/rails/blob/master/
> activerecord/lib/active_record/serializers/xml_serializer.rb)
> * rails / activesupport / lib / active_support / core_ext / array /
> conversions.rb (https://github.com/rails/rails/blob/master/
> activesupport/lib/active_support/core_ext/array/conversions.rb)
> * rails / activemodel / lib / active_model / errors.rb (https://
> gist.github.com/rails/rails/blob/master/activemodel/lib/active_model/
> errors.rb)
> * rails / activemodel / lib / active_model / serializers / xml.rb
> (https://gist.github.com/rails/rails/blob/master/activemodel/lib/
> active_model/serializers/xml.rb)
>
> Then I've built the same class structure I found in Rails 3 in
> RestfulX (except, that all is in a module called RestfulX), changed
> to_xml to to_fxml and made the same modifications you did. Finally
> I've thrown all the unused stuff away.
>
> So, what do you think? Am I on the right track?

Absolutely. Let me know when there's anything to pull/review.

>
> Another thing, theres is a rails3 branch in your project. Am I
> supposed to take that one or the master branch?

Please use the rails3 branch. This might get moved around when there's proper rails 3 support but for now it's obviously still work in progress so best to keep it in standalone branch.

Thanks a lot for taking initiative on this! It's much appreciated.

Dima

Dima Berastau

unread,
Dec 7, 2010, 1:24:20 PM12/7/10
to restfulx-...@googlegroups.com
Hi Bill,

No list right now, but it's essentially a two part job:

1. Port over the *core*: (to_fxml, to_amf, activerecord, activecontroller patches, etc). Looks like Georg has started on that.

2. Port over the generators. At the moment there are 2 sets of generators. 1 based on rubigen (for standalone apps, such as AIR, etc that use no Rails back-end), the other one based on generator architecture in Rails 2 so they integrate nicely into Rails apps. Rails 3 is using thor (which is way better incidentially). For restfulx I suspect we can rewrite all the generators to use thor and thus get rid of custom for rails and standalone for AIR/GAE apps.

Makes sense?
Dima

William P Voll

unread,
Dec 7, 2010, 3:37:54 PM12/7/10
to restfulx-...@googlegroups.com
Dima,

That makes total sense and Thor does seem much better. I will start on
the rewrite of the rails generators.

Thanks

Bill

Dima Berastau

unread,
Dec 7, 2010, 6:52:01 PM12/7/10
to restfulx-...@googlegroups.com
Hi Bill,

Thanks a lot for taking initiative on this! I'll do my best to help out. Been very busy with client work recently so couldn't keep up with maintenance on RestfulX but I am sure I'll carve out some time soon.

Dima

jorgeramos

unread,
Jan 3, 2011, 3:38:37 PM1/3/11
to restfulx-framework
Hello All, I've been following this group to see about future Rails 3
implementations and I was wondering how far along we are from having
Rails 3 support with this framework. This project looks great and I
have interest in using it in an upcoming project but can only use it
if it supports Rails 3. Thanks...

Dan Tripp

unread,
Jan 3, 2011, 7:19:16 PM1/3/11
to restfulx-...@googlegroups.com
From what I understand the RestfulX Framework proper (the SWC and AS magic) work fine with Rails 3 ('cause they're not Ruby/Rails-dependent whatsoever) but the generators have some relatively minor issues.

If you're interested, especially since you have a Rails 3 requirement, then it'd be a great place for you to jump in and help.

- Dan




--

jorgeramos

unread,
Jan 4, 2011, 3:55:57 AM1/4/11
to restfulx-framework
I'd love to help and work with someone to get the generators working.
However, my strength is definitely in the Flash side... implementing
Design Patterns in AS3 etc... I'm very new to Rails but if someone
wants to work with me for the integration from the Rails side I'm game
for the Flash / Flex generators...

Dima Berastau

unread,
Jan 4, 2011, 9:03:36 PM1/4/11
to restfulx-...@googlegroups.com
Hi,

Rails3/Flex4 compatibility is next on the agenda. Flex4 support within the framework (AS3 side) is pretty much done. See flex4 branch in restfulx_framework project.

As far the gem is concerned the following is the case (Refer to rails3 branch in restfulx project):

1. Core Rails3 support is pretty close to complete (things like to_fxml/to_amf work, ActiveModel/ActionController compatibility, etc)
2. Templates for Flex4 compatibility are also pretty much complete

The biggest outstanding issue is actually rewriting generators to be based on Thor (and hence become Rails3 compatible).

If you look at https://github.com/dima/restfulx

You'll notice app_generators, rails_generators and rxgen_generators folders.

app_generators and rxgen_generators are for standalone usage (based on rubigen) and are used for code generators in environments that don't require/use Rails.

rails_generators are for use within Rails2.

Ideally, all of the code generators will be done from the same core structure and Rails3/Thor architecture does allow that kind of refactoring

So in terms of the biggest bottleneck right now there's essentially one:

3. Rewriting code generators to be based on Thor and updating code templates as appropriate.

A very good starting point is https://github.com/indirect/rails3-generators. If you go through some of the code generation in restfulx and rails3-generators you'll get the hang of it very quickly.

Let me know if you want to help with that. Perhaps there's more experienced Rubyists out there who are willing to jump in on this too?

Dima

William Voll

unread,
Jan 4, 2011, 9:59:24 PM1/4/11
to restfulx-...@googlegroups.com
Dima

Sorry I didn't get any time at year end to work on generators. I have time now

Bill

Sent from my iPhone

Dima Berastau

unread,
Jan 5, 2011, 1:57:26 AM1/5/11
to restfulx-...@googlegroups.com
Hi Bill,

No problem. Just to update you on the current state of affairs.

Check out rails3 branch of dima/restfulx project on github. You should already be able to install the gem on your system and use it in a rails3 project.

Things like:

YourModel.to_fxml should work as should responds_with :fxml in your controller.

Rake tasks that restfulx gem adds should also be pulled in correctly. Do rake -T to verify. I'll do a bit more work to port AMF stuff to Rails3 in the next few days at which point of time getting to the generators will be the big thing that's left.

Thanks again for your help!

Dima

Dariel Subiros

unread,
Jan 18, 2011, 4:05:14 PM1/18/11
to restfulx-framework
Hi Dima:

Don't you still have a date in mind for when will restfulx support
rails3 and flex4 officially?

I'm waiting for example, to use Devise auth system with rails3, which
have more features for rails3 devise's branch, but haven't ever used
rails3 before, just waiting for restfulx to jump to rails3, but
knowing I won't look back to rails2.

Thank.
Dariel.


On Jan 5, 1:57 am, Dima Berastau <dima.beras...@gmail.com> wrote:
> Hi Bill,
>
> No problem. Just to update you on the current state of affairs.
>
> Check out rails3 branch of dima/restfulx project on github. You should already be able to install the gem on your system and use it in a rails3 project.
>
> Things like:
>
> YourModel.to_fxml should work as should responds_with :fxml in your controller.
>
> Rake tasks that restfulx gem adds should also be pulled in correctly. Do rake -T to verify. I'll do a bit more work to port AMF stuff to Rails3 in the next few days at which point of time getting to the generators will be the big thing that's left.
>
> Thanks again for your help!
>
> Dima
>
> On 2011-01-04, at 6:59 PM, William Voll wrote:
>
>
>
> > Dima
>
> > Sorry I didn't get any time at year end to work on generators. I have time now
>
> > Bill
>
> > Sent from my iPhone
>
> > On Jan 4, 2011, at 9:03 PM, Dima Berastau <dima.beras...@gmail.com> wrote:
>
> >> Hi,
>
> >> Rails3/Flex4 compatibility is next on the agenda. Flex4 support within the framework (AS3 side) is pretty much done. See flex4 branch in restfulx_framework project.
>
> >> As far the gem is concerned the following is the case (Refer to rails3 branch in restfulx project):
>
> >> 1. Core Rails3 support is pretty close to complete (things like to_fxml/to_amf work, ActiveModel/ActionController compatibility, etc)
> >> 2. Templates for Flex4 compatibility are also pretty much complete
>
> >> The biggest outstanding issue is actually rewriting generators to be based on Thor (and hence become Rails3 compatible).
>
> >> If you look athttps://github.com/dima/restfulx
>
> >> You'll notice app_generators, rails_generators and rxgen_generators folders.
>
> >> app_generators and rxgen_generators are for standalone usage (based on rubigen) and are used for code generators in environments that don't require/use Rails.
>
> >> rails_generators are for use within Rails2.
>
> >> Ideally, all of the code generators will be done from the same core structure and Rails3/Thor architecture does allow that kind of refactoring
>
> >> So in terms of the biggest bottleneck right now there's essentially one:
>
> >> 3. Rewriting code generators to be based on Thor and updating code templates as appropriate.
>
> >> A very good starting point ishttps://github.com/indirect/rails3-generators. If you go through some of the code generation in restfulx and rails3-generators you'll get the hang of it very quickly.
>
> >> Let me know if you want to help with that. Perhaps there's more experienced Rubyists out there who are willing to jump in on this too?
>
> >> Dima
>
> >> On 2011-01-04, at 12:55 AM, jorgeramos wrote:
>
> >>> I'd love to help and work with someone to get the generators working.
> >>> However, my strength is definitely in the Flash side... implementing
> >>> Design Patterns in AS3 etc... I'm very new to Rails but if someone
> >>> wants to work with me for the integration from the Rails side I'm game
> >>> for the Flash / Flex generators...
>
> >>> --
> >>> You received this message because you are subscribed to the Google Groups "restfulx-framework" group.
> >>> To post to this group, send email to restfulx-...@googlegroups.com.
> >>> To unsubscribe from this group, send email to restfulx-framew...@googlegroups.com.
> >>> For more options, visit this group athttp://groups.google.com/group/restfulx-framework?hl=en.
>
> >> --
> >> You received this message because you are subscribed to the Google Groups "restfulx-framework" group.
> >> To post to this group, send email to restfulx-...@googlegroups.com.
> >> To unsubscribe from this group, send email to restfulx-framew...@googlegroups.com.
> >> For more options, visit this group athttp://groups.google.com/group/restfulx-framework?hl=en.

Dima Berastau

unread,
Jan 18, 2011, 4:39:53 PM1/18/11
to restfulx-...@googlegroups.com
Hi Dariel,

There's flex4 branch on restfulx_framework and rails3 branch on restfulx gem on github. flex4 support is pretty much complete on Flex-end.

Rails3 support is functionally almost there except for generators. If you are using to_fxml and don't need code generation you can use Flex 4/Rails 3 already. I don't have a specific launch date in mind = as soon as it's ready. If somebody helps with the generators that would be earlier of course.

Dima

iRonin

unread,
Mar 8, 2011, 6:23:21 AM3/8/11
to restfulx-framework
Hello!

Is it possible to get an update on current Rails3 support status and
upcoming releases?

Thanks!
Cyprian
Reply all
Reply to author
Forward
0 new messages