[Rails] ROR return JSON with 406 Not Acceptable error

2011-12-09 Thread Krishnaraj KR
When we return JSON output using 'render :json =>@profiles', the output will return the required results with a 406 error. How can avoid that 406 Not Acceptable error ? Function - def import #json= params[:data] @details = JSON.parse(json) @profiles = Profile.where(@details

[Rails] Re: database relation's tying to pull data from another table

2010-04-29 Thread KR
Thx I figured it was something that simple On Apr 29, 7:30 am, Tim Shaffer wrote: > You need to add another loop for the cards: > > <% @collections.each do |collection| %> > <% collection.cards.each do |card| %> > <%= card.title %> > > -- > You received this message because you are subscribed to

[Rails] database relation's tying to pull data from another table

2010-04-28 Thread KR
I need some newb help here. I am making a quick app to learn on to hold my collection of cards. I have a card database with a ton of fields, and also a collection table. my collection has_many cards, and cards belongs_to collection. I'm trying to list out cards in my collection, and pulling the

[Rails] [newb] Controller Help

2009-09-01 Thread KR
Hey all been working on my first app that is to help track projects and who's working on them. I want to be able in the project controller find employees in the employee controller by project_id, and then list them on my show defenition. I thought this would work but ofcourse it doesn't and I ca

[Rails] Re: Adding database fields to get a total

2009-08-24 Thread KR
Sweet thanks it worked. Not so bad after all! On Aug 24, 12:43 pm, Aldric Giacomoni wrote: > E. Litwin wrote: > > Create a virtual attribute in the model that returns the grand total. > > > def grand_total > >   field_1 + field_2 ... > > end > > > You can then reference grand_total from your vi

[Rails] [Newb] Adding database fields to get a total

2009-08-24 Thread KR
Total newb here, as I've been working my way threw the tutorial, but doing my own thing. I've created a fairly simple app, that has a bunch of items. Each item has 6-9 fields that have a cost associated with them (db field = float). Think of each item as a car maintenance log, oil change = $50.0

[Rails] zlib-devel without root privilage

2009-07-17 Thread Kr Kr
Hi i have problem with zlib-devel (problem with "gem install rails"), i compiled zlib, but i dont ktow how to provide ruby zlib-dev dependency. In subject i mention - i dont have root privilage :/ -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You

[Rails] Using view from different controller

2008-10-18 Thread Christoph Kr
Hi, I (newbie) work on an application that uses the last.fm api and request the top albums from Last.fm. so I have a lastfm_controller with the action caches_view: top_albums def top_albums get_albums(params[artist]) #gets top albums from end and a top_albums.rhtml that renders a list of t