On 17 May 2011, at 02:20, John Merlino li...@ruby-forum.com wrote:
THe guy says:
The first instance_eval is used to add class method has_attribute into
Object so that we can call it in all the inherited class.
I'm a little thrown off by this statement. First, Object itself is an
instance
The action 'posts' could not be found for UsersController
http://localhost:3000/users/posts
routes your request to UsersController#posts, but method 'posts' is not
there.
Add 'posts' method to UsersController, and your problem is solved.
http://blog.eugen.co
--
Posted via
On 17 May 2011 09:27, Eugen Ciur li...@ruby-forum.com wrote:
The action 'posts' could not be found for UsersController
http://localhost:3000/users/posts
Add 'posts' method to UsersController, and your problem is solved.
Or... you have just created a whole load of different problems... :-/
On 17 May 2011 06:26, Chad Eubanks chadcreat...@gmail.com wrote:
In my routes file I have the following nested resource:
resources :users do
collection do
get 'posts'
end
end
PS Just to clarify, rather than collection you possibly want to use
the syntax:
resources
I think you are just confused by the overloaded use of the words objct
and class as opposed to the ruby classes named Object and Class.
This diagram / project might help clarify
http://objectgraph.rubyforge.org/dotOG.html
From
http://objectgraph.rubyforge.org/
Max
On 5/16/11, John Merlino
Colin Law wrote in post #999008:
On 14 May 2011 13:04, comopasta Gr li...@ruby-forum.com wrote:
So my doubts are:
- Should I set the custom identifier as the primary key and remove the
default id?
No
- Or should I keep the default Id but instead fill it with the custom
identifier?
No
I've looked into this and it seems that there is no mechanism in AC
that would call to_csv automatically. The code in action_controller/
metal/renderers.rb suggests that xml and json are just two special
cases that do that.
On Mar 31, 3:01 pm, mfilej miha.fi...@gmail.com wrote:
Did you have any
Could someone help me with an authentication/authorisation design
please?
It's for a car garage application that allows a customer to monitor the
status of their car. Here are my requirements:
1. I need a heirarchy of 4 users:
A. Superuser (me)
B. Garage owner.
C. Mechanic.
On 17 May 2011 11:06, comopasta Gr li...@ruby-forum.com wrote:
Colin Law wrote in post #999008:
..
Why store the tag identifier in the statistic?
Externally the tag is known by its identifier. They are tags that are
read with the mobile and when they come to the server they are found by
Sent from my iPhone
On May 16, 2011, at 1:33 PM, Rebecca Dias li...@ruby-forum.com wrote:
Mike I am also a newbie. Where might I find this bundle file?
It's called Gemfile and it's in the root of your application folder.
B.
--
Posted via http://www.ruby-forum.com/.
--
You
I still have the same problem with Ruby 1.9.2...
===
I 05/17/2011 21:56:20:387 1638 APP| Error:
#REXML::ParseException: Declarations can only occur in the doctype
declaration.
Line: 39
Position: 2342
Last 80 unconsumed characters:
![CDATA[pSDM
Hello All,
i have strugled in connection between java(jdk1.6_17) and ruby on rails
under Webrick server... I am using IDE netbeans( version 7 ). dats why i
need configure with apache (wamp 2.0)..i saw some tutorials about
configuring..
What environment are you coming from? Unix, Mac, Windows? Let's assume
you're using some Unix variant, as you should, and Apache2 is already
properly installed:
1. install phusion passenger:
$ gem install passenger
2. install passenger-apache2-module:
$ passenger-install-apache2-module
Be sure
Sent from my iPhone
On May 17, 2011, at 8:02 AM, Thomas Dalla li...@ruby-forum.com wrote:
I still have the same problem with Ruby 1.9.2...
===
I 05/17/2011 21:56:20:387 1638 APP| Error:
#REXML::ParseException: Declarations can only occur in
Don't forget, you can also add a database index to a field that is going to
be searched often, that will improve search performance.
In your model's migration:
add_index(table_name, column_names, options)
from: http://api.rubyonrails.org/classes/ActiveRecord/Migration.html
Hi
I`m trying to test my controller with rspec and always get an error.
The error is in the render_to_string method call (without it test
works fine). So could u please help me with that?
users_controller.rb:
def update
@user.update_attributes!(params[:user])
redirect_to @user, :status
Hi
This is Rama with quantum InfoTech
QA Testers QA with Selenium and Agile for Reston VA
Duration: 3 months + (strong likelihood of an extension)
Location : Reston VA
We are seeking QA Testers for a contract position in Reston, VA.
-Will need to have solid web services testing experience.
After upgrading from rails 2.3.3 to rails 2.3.8, i've lost the ability
to parse xml parms sent via tests using @request.env['RAW_POST_DATA'] =
xml.
Rails stopped parsing the content of the raw_post_data into params which
made all the test that depend on this fail. I'm also setting
@request.accept
Not sure I understand whether the problem is capturing the business
relationships in your Rails models, or applying your authorization
frameworks to your app. Hope this helps a bit:
It seems to me you would want to associate your Customers, Mechanics, and
Garage Owners to some sort of Garage
On 17 May 2011 14:49, Dice requirement dice.requireme...@gmail.com wrote:
This is Rama with quantum InfoTech
Hi Rama,
This is a Rails list... not a Selenium list. Sure, *some* here have
experience with the tools you're looking for, but that's no excuse for
the off-topic post. There are Selenium
Michael,
I initially I was using resources as oppose to collection. I ran take routes
and users/posts is a valid route.
Ultimately I am trying to keep a relationship between the two models but remove
the user id from the URL.
Kind Regards,
Chad Eubanks
The Code Boutique
Sent from my
On 17 May 2011 15:30, Chad Eubanks (gMail) chadcreat...@gmail.com wrote:
Ultimately I am trying to keep a relationship between the two models but
remove the user id from the URL.
You can keep a relationship between models without *any* nesting of
routes. Whether a Post belongs to a User, or
Thanks for the reply Paulo, my question was about the business
relationships involved, and I think you went a long a way towards
answering it.
With regards to a Customer being associated with multiple Garages, good
news, this is not possible, they would have to have separate accounts.
Your
The end goal is this: I have a client app that is proxing json from the rails
server. Our current way of using /users/id/posts.json as the url proxied does
not work as needed. I would like to set a relation between the user and post
model but NOT have a nested url. The desired scenario is
Hi all,
I'm trying to develop a video annotation application with Rails. First
things I need to do is to select a bounding box of an object in a video
frame and back it up in my database.
From now I was able to draw some bounding boxes using javascript and
the canvas elements of html5. But I
Does anyone know how to change the default option for the Date.parse
(which ActiveRecord is using on all date fields). I would like the
comp option to default to true so I don't have to account for 2-
digit dates throughout my application.
http://corelib.rubyonrails.org/classes/Date.html#M001228
I have a rails app which supports multiple domains and each domain may
have multiple subdomains.
Users visiting mydomain1.com do not receive the same experience as
mydomain2.com (although the base behaviour of the apps is the same)
Therefore, if a user is logged in to mydomain1.com, it shouldn't
I think trying to model all those relationships solely in your user models
will turn out way more complicated than adding a few extra models to your
app to help capture those relationships. Your concerns about data coupling
are valid, but at some point, you'll have to store the information about
hi there,
i thing i just have a logical problem.
i have following models.
class Area ActiveRecord::Base
belongs_to :taskschedule
belongs_to :service
end
class Service ActiveRecord::Base
has_many :taskschedules, :through = :areas
has_many :areas
end
class
The way I understand it, Mauro has his models stored in different databases,
i.e., his rails app is running on one DB server (SQLite/PostgreSQL/X) and he
wants to fetch data on another DB server (Oracle), is that so? In that case,
it would do good to look here:
i'm not sure if this is the right place for this but it its an
activerecord issue so hopefully it is.
anyway when ever i try and save a model it come back as true but when i
find the object again it hasn't changed.
For example:
p = Post.find 1
p.title.capitalize!
p.save # Returns true but
On Monday, May 16, 2011 7:08:11 PM UTC-6, Ruby-Forum.com User wrote:
Hi,
There doesn't seem to be any reference for taking HTML snapshots from
within a Rails server. I wonder how one could implement Google's
crawlable AJAX spec
I have been poking around the rails guides section on migrations
(http://guides.rubyonrails.org/v2.3.8/migrations.html#changing-tables)
and trying to make sure I have the proper syntax to change a column
type for an existing field from string to text (without losing data
already entered). What is
On 17 May 2011 18:30, Paulo Muggler Moreira paulomugg...@gmail.com wrote:
The way I understand it, Mauro has his models stored in different databases,
i.e., his rails app is running on one DB server (SQLite/PostgreSQL/X) and he
wants to fetch data on another DB server (Oracle), is that so?
Yes
which rails?
try (in console)
p = Post.find 1
p.title.capitalize!
p.title
p.save
p.errors.inspect
tom
On May 17, 2011, at 19:45 , james b. wrote:
i'm not sure if this is the right place for this but it its an
activerecord issue so hopefully it is.
anyway when ever i try and save a
On 17 May 2011, at 18:45, james b. li...@ruby-forum.com wrote:
i'm not sure if this is the right place for this but it its an
activerecord issue so hopefully it is.
anyway when ever i try and save a model it come back as true but when i
find the object again it hasn't changed.
For
On Tue, May 17, 2011 at 9:50 AM, eddyjab edja...@gmail.com wrote:
hi there,
i thing i just have a logical problem.
i have following models.
class Area ActiveRecord::Base
belongs_to :taskschedule
belongs_to :service
end
class Service ActiveRecord::Base
has_many
Hi guys,
My name is Chad Eubanks and I am the founder of a small team called The Code
Boutique. We specialize in web development using Rails and Sproutcore.
SproutCore is a html5 framework with Yehuda Katz on the core team.
I am looking for another rails developer to help my team bridge the
On Monday, May 16, 2011 11:36:30 PM UTC-6, News Aanad wrote:
hi I am implementing delayed_job in my rails app.
*my code is:*
file name is: my_worker.rb
require delayed_job
require rubygems
class MyClass
def perform
while true do
puts I am in My class!!!
sleep 2
I still dont think I am fully clear on the Class class role.
For example:
ruby-1.8.7-p330 :010 class Class
ruby-1.8.7-p330 :011? def is_a?
ruby-1.8.7-p330 :012? puts 'a'
ruby-1.8.7-p330 :013? end
ruby-1.8.7-p330 :014? end
= nil
ruby-1.8.7-p330 :015 A.is_a?
a
= nil
ruby-1.8.7-p330
On Tuesday, May 17, 2011 6:40:26 AM UTC-6, makaroni4 wrote:
Hi
I`m trying to test my controller with rspec and always get an error.
The error is in the render_to_string method call (without it test
works fine). So could u please help me with that?
Does the controller action run fine
i understand. i have 3 models. taskschedule, services and areas. each
taskschedule has many services through the model area.
when i add(create/update) services to taskschedule i want to enter
also some information to the model area. hope that makes sence.
thanks
ed
On May 17, 2:33 pm, David
Let me see if I fully understand this.
This:
Object.instance_eval
def a
puts 'a'
end
end
is equivalent to this:
class Object
def self.a
puts 'a'
end
end
Basically, instance_eval invoked on Object creates a new class method
for the Object class (or for class Class? and if it is
I'm upgrading our Rails app from 2.1 to 2.3.11. Yes, this is
difficult. :-)
Our application controller contains the following line:
session :off, :if = Proc.new {|req| req.user_agent =~ BOT_REGEX}
The purpose of this line is to prevent the creation of sessions for
the Googlebot and other
First I want to thank the community for their help and here is my
question :)
I have a simple add to fdavourites functionality. A user can add a post
to their favouirites. Thing is I want to display the add to favourites
button if the post is not in the user's favs and something else if it
is, so
On 17 May 2011 17:11, TomRossi7 t...@themolehill.com wrote:
Does anyone know how to change the default option for the Date.parse
(which ActiveRecord is using on all date fields). I would like the
comp option to default to true so I don't have to account for 2-
digit dates throughout my
Thanks so much for your help Paulo, it's really appreciated.
--
Posted via http://www.ruby-forum.com/.
--
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
ActiveRecord, by default, parses strings using the Date.parse method. I'm
trying to figure out how to tell it to use the comp=true option so it will
parse two-digit years more logically. Currently, the default is false which
allows you to say person.birthday= '10/29/75' and it parses that as
Well googled a bit more as I am impatient. Credit for this answer goes
to
http://www.cowboycoded.com/2009/10/07/change-a-column-data-type-with-rails-migration/
Thanks cowboy.
On May 17, 1:59 pm, sol.manager sol.mana...@gmail.com wrote:
I have been poking around the rails guides section on
I think you need .any?
On May 17, 3:50 pm, Stefan Gelenchev li...@ruby-forum.com wrote:
First I want to thank the community for their help and here is my
question :)
I have a simple add to fdavourites functionality. A user can add a post
to their favouirites. Thing is I want to display the
Played with the code for hours and just got it to work, 20 minutes after
posting here. ruby-forum.com brought me luck, thank you :)
Here the working code:
% if current_user.favourites.exists? :post_id = @post.id %
So it checks the favs of the current_user in the fawvourites table and
compares
Thanks very much i had been pondering on this for a while
Final Solution:
p.title = p.title.capitalize
instead of
p.title.capitalize!
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post to
On 17 May 2011 20:57, TomRossi7 t...@themolehill.com wrote:
ActiveRecord, by default, parses strings using the Date.parse method. I'm
trying to figure out how to tell it to use the comp=true option so it will
parse two-digit years more logically. Currently, the default is false which
allows
On Tuesday, May 17, 2011 3:51:38 PM UTC-4, Colin Law wrote:
On 17 May 2011 17:11, TomRossi7 t...@themolehill.com wrote:
Does anyone know how to change the default option for the Date.parse
(which ActiveRecord is using on all date fields). I would like the
comp option to default to true
What does it matter where the data comes from? ActiveRecord parses it the
same? If you don't know, or if it isn't possible, thats fine, but I don't
want to overcomplicate the question.
On Tue, May 17, 2011 at 4:21 PM, Colin Law clan...@googlemail.com wrote:
On 17 May 2011 20:57, TomRossi7
On 17 May 2011 21:37, TomRossi7 t...@themolehill.com wrote:
On Tuesday, May 17, 2011 3:51:38 PM UTC-4, Colin Law wrote:
On 17 May 2011 17:11, TomRossi7 t...@themolehill.com wrote:
Does anyone know how to change the default option for the Date.parse
(which ActiveRecord is using on all date
I am getting this error on the redirect_to command ...
I am using Rails 3 w Paperclip to upload files ( but I tried also
CarrierWave .. same error)
I tried to change the session store from cookie-based to database ..
same error
I tried to delete the params content ...
I don't know what to try
Have you considered using the Chronic gem?
I don't know how to do what you're asking but have recently implement
Chronic to make date parsing more sane. (Actual verbiage from my
assigned task.)
It's quite a handy gem, you might consider implementing it.
http://chronic.rubyforge.org/
On May 17,
Sent from my iPhone
On May 17, 2011, at 1:58 PM, eddyjab edja...@gmail.com wrote:
i understand. i have 3 models. taskschedule, services and areas. each
taskschedule has many services through the model area.
when i add(create/update) services to taskschedule i want to enter
also some
This worked for me. A minor correction: libmysql.dll is in mysql/lib
folder and paste it to your ruby/bin folder!!!
Yacobus Reinhart wrote in post #664497:
[1] gem install mysql
[2] you will see like error syntac but dont pay attention to it
[3] find LIBMYSQL.DLL from your mysql/bin folder in
On Tue, May 17, 2011 at 4:54 PM, Colin Law clan...@googlemail.com wrote:
On 17 May 2011 21:37, TomRossi7 t...@themolehill.com wrote:
On Tuesday, May 17, 2011 3:51:38 PM UTC-4, Colin Law wrote:
On 17 May 2011 17:11, TomRossi7 t...@themolehill.com wrote:
Does anyone know how to change
On May 17, 7:43 pm, John Merlino li...@ruby-forum.com wrote:
I still dont think I am fully clear on the Class class role.
For example:
ruby-1.8.7-p330 :010 class Class
ruby-1.8.7-p330 :011? def is_a?
ruby-1.8.7-p330 :012? puts 'a'
ruby-1.8.7-p330 :013? end
ruby-1.8.7-p330
here is the taskschedule#new view
%= form_for @taskschedule, :url=taskschedules_path do |f| %
pArea: %= f.text_field :name %/p
% for service in Service.find(:all) %
p%= check_box_tag :service_ids, service.id,
@taskschedule.services.include?(service), :name =
or p.update_attribute(:title, p.title.capitalize) and without p.save
or if you want to capitalize in your model (when saving), you could do that
with before filter
before_save do |row|
row.title = row.title.capitalize unless row.title.blank?
end
tom
On May 17, 2011, at 22:17 , james b.
I am using nested forms with multiple instances of various of the forms. The
problem I cant figure out is how to maintain state for the select between
postbacks. I am using 'options_from_collection_for_select' and in this the
last param is to be the selected value, but given the dynamic nature,
On Tue, May 17, 2011 at 4:38 PM, eddyjab edja...@gmail.com wrote:
here is the taskschedule#new view
%= form_for @taskschedule, :url=taskschedules_path do |f| %
pArea: %= f.text_field :name %/p
% for service in Service.find(:all) %
p%= check_box_tag :service_ids,
On Tue, May 17, 2011 at 4:01 PM, Erwin yves_duf...@mac.com wrote:
I am getting this error on the redirect_to command ...
I am using Rails 3 w Paperclip to upload files ( but I tried also
CarrierWave .. same error)
I tried to change the session store from cookie-based to database ..
same
On Tue, May 17, 2011 at 2:32 PM, robinluc...@gmail.com
robinluc...@gmail.com wrote:
I'm upgrading our Rails app from 2.1 to 2.3.11. Yes, this is
difficult. :-)
Our application controller contains the following line:
session :off, :if = Proc.new {|req| req.user_agent =~ BOT_REGEX}
The
Hi,
I'm trying to use the command tail and it keeps on saying: 'tail' is not
recognized as an internal or external command, operable program or batch
file. I've installed the gem 'file-tail' to try to solve this, but I'm
not really sure that this gem is what I'm looking for cuz it still
doesn't
it worked ofcourse. Thanks again.
--
Posted via http://www.ruby-forum.com/.
--
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
It's not defining it on Class, it's defining it on the Object class. Every
class inherits from Object, so every class inherits that class method.
If you define it on a different class, it will belong to that class and its
descendants:
String.instance_eval do
def test_method
test
end
71 matches
Mail list logo