warhammerkid / rails3-amf Goto Github PK
View Code? Open in Web Editor NEWA Rails 3 plugin that provides tight rails amf integration
A Rails 3 plugin that provides tight rails amf integration
Hello Warhammerkids,
I am changing from RubyAMF (rails 2 - rubu 1.8 to Warhammerkids Rails3-amf - (rails 3.0.3 - ruby 1.9.2)
It's a great choice !!!
Thanks for this Gem !!!!
One those issues is, how can I get records from an association to the array, which is sent back to the Flex-Application.
(I have update the rails3-amf with commit 63ce564)
in my controller :
def find_all
@Inventeurs = Inventeur.all
respond_with(@inventeurs) do |format|
format.amf { render :amf => @inventeurs.to_amf(:include => [:choses]) }
end
end
With this code I get back all correctly typed Inventeur Objects as an Array, with the records from the ":include" argument[:choses].
but all the attributes of ChoseVO are not transmitted except “commentaire”.
ChoseVO Object
public class ChoseVO implements IValueObject {
public var id:int;
public var dateDepot:Date;
public var inventeurId:int;
public var categorieId:int;
public var couleurId:int;
public var marqueId:int;
public var rangementId:int;
public var dateRestitution:Date;
public var declarationId:int;
public var commentaire:String;
public var dateApurement:Date;
Thanks for any help.
This isn't an issue per se, but I didn't know how else to contact you.
You are quoted here stating that AMF has it's own system for preventing CSRF. Can you elaborate on that? I've been researching this exact topic and haven't found anything anywhere so far that gives a definitive answer on whether a backend exposing Flex RPC services is vulnerable to CSRF.
Hi,
I can't access the sessions hash on the controller. Any ideas?
I followed this example
http://panscendo.com/beginners-tutorial-to-rubyamf-with-restful-rails/
to setup "messages". When I run
format.amf {render :amf => @messages.to_amf(:except => [:updated_at, :created_at])}
I get an undefined method error.
If I run
format.amf {render :amf => @messages}
I get the expected return array.
Hi Warhammerkid,
I just updated my rails3-amf installation to the latest release from Github. After this update Rails3amf is returning an array of data, but only the first record in this array is of the correct Type. Pls. see this example:
returned result from Rails:
[0...99]
[0] com.myw.vo.UserVO (@32619921)
[1] Object (@37d4d671)
[2] Object (@35c48779)
[3] Object (@355821f1)
[4] Object (@360fa2e1)
[5] Object (@357824a9)
[6] Object (@37d4d1d9)
[7] Object (@37d4df89)
[8] Object (@37e89d79)
[9] Object (@37c54401)
[10] Object (@35782e69)
Do have I have to change something, or is this a little bug ?? In the version prior to this update, everything went fine.
Thanks and regards
Christian
Discussed here: http://stackoverflow.com/questions/5665662/rails3-amf-to-amf-method-not-found-on-activerecord-objects
Worked around the issue by adding the following in an initializer:
class ActiveRecord::Base include Rails3AMF::Serialization end
I am not sure about the exact cause of this issue. If you want me to run any tests to confirm the cause, please tell me.
Completed 200 OK in 30473ms (Views: 1.8ms | ActiveRecord: 0.8ms)
Sending back AMF
SystemStackError (stack level too deep):
Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.0.0/lib/action_dispatch/middleware/templates/rescues/_trace.erb (5.1ms)
Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.0.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (9.5ms)
Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.0.0/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (74.8ms)
I've tried to debug and just discovery that RocketAMF does not serialize well an array of model instances. Here is my controller code:
def posts
@posts = Post.all
render :amf => @posts
end
I can't implement a two level association as follows:
@posts = Post.where(:category_id => params[:id]).includes(:author => :phones)
respond_with(@posts) do |format|
format.amf { render :amf => @posts.to_amf( :include => ???? ) }
end
Any sugestions?
How can I return a boolean or string value?
format.amf { render :amf => false }
It doesn't work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.