On 18 October 2012 23:30, chardy <[email protected]> wrote: > Hi, > > I'm trying to work with a RESTful server but I have some problem to setup my > project. > I have a model class like this : > >> class User < ActiveResource::Base >> >> self.site = >> "http://diufvm31.unifr.ch:8090/CyberCoachServer/resources/users/" >> >> end > > > this controller : > >> class UsersController < ApplicationController >> >> def new >> >> end >> >> def index >> >> @users = User.find(:all) >> >> >> respond_to do |format| >> >> format.html # index.html.erb >> >> format.json { render :json => @users } >> >> format.xml { render :xml => @users} >> >> end >> >> end >> >> end >> >> > > > and simply this view : > >> <% @users.each do |user| %> >> >> <p><%= user.username %></p> >> >> <% end %> >> >> > > > But I can't retrieve the data, @users is empty. > Anyone has an idea how to fix this issue?
Is there anything useful in log/development.log? Colin > > Thanks > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/fjonPR37-AQJ. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

