bragi / representations

Simple representations for ActiveRecord models
MIT License
7 stars 2 forks source link

All forms for resource_controller post to "objects/" #32

Closed mkwiatkowski closed 14 years ago

mkwiatkowski commented 14 years ago

Name of the representation is derived from the instance variable name (ViewHelpers.find_variable_name), but that combined with resource_controller means all representations will get name "object". Why not base the name of the class name? See http://github.com/infrared/representations/commit/e13c638294478c97c302677e5cb0e73db9d73504

See also bug #33.

asok commented 14 years ago

Are you sure? Variables from controller seem to have proper names. Some trainee could look at this please. Feel free to contact me when some questions arise.

mkwiatkowski commented 14 years ago

If you have posts resource controller it will have both @object and @post instance variables. Depending on which will be returned first by controller.instance_variables method that will be the return value of ViewHelpers.find_variable_name.

The assumption that you can base your URL on the name of an instance variable is plain wrong. Please see my comment in #33 on polymorphic_path for a better way to do this.

asok commented 14 years ago

Ok, thank you. I will look at this when I find some spare time.

gruby commented 14 years ago

rest routes should work right now.