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?

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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
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.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 13 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedOct 19, '12 at 10:49a
activeOct 21, '12 at 9:17p
posts13
users3
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2021 Grokbase