On 17 May 2011, at 02:20, John Merlino 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 of class Clas
a small correction in your form
<%form_for(:person) do |f|%>
On Tue, May 17, 2011 at 11:12 AM, bala TS wrote:
> html.erb
>
> <%form_for(:person do |f|)%>
> <%= check_box(:person,:permanent_employee,:options=>{},:on_value =>
> "1",:off_value => "0")%>
> <%end>
>
> controller
> edit_method
>
html.erb
<%form_for(:person do |f|)%>
<%= check_box(:person,:permanent_employee,:options=>{},:on_value =>
"1",:off_value => "0")%>
<%end>
controller
edit_method
@person=Person.find_by_id(params[:id])
@person.update_attributes(params[::person])
@person.permanent = params[:person][:permanent_e
html.erb
<%form_for(:person do |f|)%>
<%= check_box(:person,:permanent_employee,:options=>{},:on_value =>
"1",:off_value => "0")%>
<%end>
controller
edit_method
@person=Person.find_by_id(params[:id])
@person.update_attributes(params[::person])
@person.permanent = params[:person][:permanent_e
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
end
end
end
Delayed::Job.enqueue( MyClass.new )
#m.perform
Hi guys,
In my routes file I have the following nested resource:
resources :users do
collection do
get 'posts'
end
end
However, when I visit this URL: http://localhost:3000/users/posts, I get this
error: "The action 'posts' could not be found for UsersController"
In
Thanks for pointing out the obvious Frederick (seriously, thank you).
The problem was completely on the JavaScript/browser side; the
function which prepared the query string was using escape() rather
than encodeURIComponent(). I replaced all the calls to escape and
things started to magically work
jiblethead wrote in post #999139:
> Maybe a bit off-topic here, but I have a site "mysite.com" and an
> action that will take "mysite.com/keyword" and find the most
> appropriate page for that keyword. I did it as a way to handle old
> bookmarks that I can't control, but still provide content that
Hey all,
I am a little confused about a tutorial I read. Here's an example below
taken from the tutorial:
Object.instance_eval do
def has_attribute( *attrs )
attrs.each do | attr |
self.class_eval %Q{
def #{attr}=(val)
instance_variable_set
> but instances of Object aren't i.e. Object.kind_of? Class is the wrong
> test - Object.new.kind_of?(Class) (or in your specific example,
> Peach.new.kind_of?(Class)) is the relevant one.
>
> Fred
Thanks for response
--
Posted via http://www.ruby-forum.com/.
--
You received this message beca
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
(http://code.google.com/web/ajaxcrawling/docs/learn-more.html)on a Rails
application?
To summarize: I have a Rails application with a Java
> I just upgraded from restful_authentication to devise, and before I
> found out there was a wiki on how to do this properly, I removed all
> traces of restful_authentication from my app, then installed Devise like
> I normally would.
>
> The issue I'm getting is I create an account, and when I co
Maybe a bit off-topic here, but I have a site "mysite.com" and an
action that will take "mysite.com/keyword" and find the most
appropriate page for that keyword. I did it as a way to handle old
bookmarks that I can't control, but still provide content that's
useful (instead of 404 error, for examp
check, what does chrome sent in headers:
eg Accept-Language -> en-us,de;q=0.7,en;q=0.3
tom
On May 16, 2011, at 23:10 , Alex Katebi wrote:
> Why does my browser think that my page has Malay in it and wants to
> translate it?
> Rails 3.1 beta using Chrome
>
> --
> You received this message beca
hi,
don't you have any of the rails apps running? try restart or shutdown your
monrel/webrick/phusion etc servers...
tom
On May 16, 2011, at 21:41 , Craig Cherlet wrote:
> I installed RVM and am getting a kinds of errors. I have managed to get
> most things back to normal but I get this error
Why does my browser think that my page has Malay in it and wants to
translate it?
Rails 3.1 beta using Chrome
--
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 unsub
On Monday, May 16, 2011 9:05:10 AM UTC-6, dhayalan wrote:
>
> Hello All,
>
> Am upgrading my rails app from rails 2.1.0 to 2.3.11, while login am facing
> bug
>
> for login am using code "self.current_user =
> User.authenticate(params[:login], params[:password])"
>
> Bug:
>
> "NoMethodError: und
Hi,
i am migration an rails 2.3 application to rails 3, and i'm having some
problems with post requests with 'octet-stream' content-type.
The problem is that rails is not passing the octet-stream params to the
controllers. We have some mobile apps (J2ME) sending us post requests with
octet-str
Sent from my iPhone
On May 16, 2011, at 2:31 PM, "wbsurf...@yahoo.com" wrote:
>
>
> So I had done some things in the past with map.resources in the
> routes, but I never really fully understood all of it, especially when
> there was more than one level with children such as:
>
> map.resources
Thank you.
On Mon, May 16, 2011 at 2:22 PM, David Kahn wrote:
>
>
> On Mon, May 16, 2011 at 1:04 PM, Rodrigo Ruiz wrote:
>
>> Now I think I got it, thank you.
>>
>> I need @user = User.new for the line 'form_for(@user)' in the view
>> 'new.html.erb' right?
>>
>> Correct
>
>
>> And what is the poi
I installed RVM and am getting a kinds of errors. I have managed to get
most things back to normal but I get this error now in one of my apps.
/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/application.rb:63:in
`inherited': You cannot have more than one Rails::Application
(RuntimeError)
So I had done some things in the past with map.resources in the
routes, but I never really fully understood all of it, especially when
there was more than one level with children such as:
map.resources :bookmarks, :has_many => [:comments]
I had kind of rushed through some examples and I sho
Thanks,
I have been through that wikipedia dry and theoretical stuff a bit
before. Some of it is useful, but I can't always seem to draw out what
are the main points that I should care the most about and what is
assumed such as client/server is obviously an assumption, but if I
don't give a full
Mike I am also a newbie. Where might I find this bundle file?
--
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 unsubscri
On Mon, May 16, 2011 at 1:04 PM, Rodrigo Ruiz wrote:
> Now I think I got it, thank you.
>
> I need @user = User.new for the line 'form_for(@user)' in the view
> 'new.html.erb' right?
>
> Correct
> And what is the point of making '@user' instead of 'user' (local variable)
> if it will be lost any
Now I think I got it, thank you.
I need @user = User.new for the line 'form_for(@user)' in the view
'new.html.erb' right?
And what is the point of making '@user' instead of 'user' (local variable)
if it will be lost anyway for other requests?
On Mon, May 16, 2011 at 1:51 PM, David Kahn wrote:
>
On 16 May 2011, at 14:47, ddellacosta wrote:
> Hi folks,
>
> Here's my basic issue, hopefully this is clear. I'm trying to submit
> some UTF-8 values in my query string, but they are coming out mangled
> on the other end. It *seems* like the problem is that what
> Rack::Utils.unescape() push
On Mon, May 16, 2011 at 12:46 PM, Rodrigo Ruiz wrote:
> if it has no knowledge of @user in the 'new' action, why do I need to do
> @user = User.new? What is the point, if it will be lost for other actions?
>
>
@user is used in @user = User.new so that you have your new user object
available for th
Paul wrote in post #999045:
> Not knowing, but as a guess I'd look at the way passwords are being
> encrypted. When you log in the first time, it probably doesn't get
> your password out of the database. So, do the encryption and
> decryption match? Are you correctly using the salt?
>
> Just a shot
if it has no knowledge of @user in the 'new' action, why do I need to do
@user = User.new? What is the point, if it will be lost for other actions?
I thought that all that i wrote with '@' in ruby was an instance variable,
meaning it is accessible to the whole instance, meaning any of its methods.
Hello All,
Am upgrading my rails app from rails 2.1.0 to 2.3.11, while login am facing
bug
for login am using code "self.current_user =
User.authenticate(params[:login], params[:password])"
Bug:
"NoMethodError: undefined method `acts_as_state_machine' for
#"
Can anyone help me out.
Thanks in
On 16 May 2011, at 16:01, Lille wrote:
> Thanks!
>
> So, maybe I automate the creation of the in-memory database with a
> rake task for the test? If not, what do you think?
>
> I think an issue here is that my modules assuming their parents are AR
> classes. Is that really modular?
Depends on
Okay, I'm still not there but I've realized I've been confusing a few
things. This stackoverflow answer helped a lot:
http://stackoverflow.com/questions/5083032/how-to-utf-8-encode-a-character-string/5083858#5083858
I was conflating Unicode with UTF-8. But, I think that's also
essentially what
Not knowing, but as a guess I'd look at the way passwords are being
encrypted. When you log in the first time, it probably doesn't get
your password out of the database. So, do the encryption and
decryption match? Are you correctly using the salt?
Just a shot in the dark...
On Mon, May 16, 2011 a
> I have file uploading functionality .present i want to before file
> save i want to run virus scan , how is it possible .Let me know any one
Might look into clamav...
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this g
+1 on wkhtmltopdf with no gem.
That has been the easiest for me.
On Mon, May 16, 2011 at 10:25 AM, David Kahn
wrote:
>
>
> On Mon, May 16, 2011 at 4:44 AM, jack kw wrote:
>>
>> I'm quite confuse with prawn and prawnto.
>> is it must install prawn with prawnto to generate pdf ?
>> what prawnto
On Mon, May 16, 2011 at 11:39 PM, Prasad B. wrote:
> Hi,
> I have file uploading functionality .present i want to before file
> save i want to run virus scan , how is it possible .Let me know any one
> .
>
>
just googled something about this and found this post.
http://stackoverflow.com/questi
Hi,
I have file uploading functionality .present i want to before file
save i want to run virus scan , how is it possible .Let me know any one
.
Thanks.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: T
Thanks!
So, maybe I automate the creation of the in-memory database with a
rake task for the test? If not, what do you think?
I think an issue here is that my modules assuming their parents are AR
classes. Is that really modular?
Lille
On May 16, 10:47 am, Frederick Cheung
wrote:
> On May 16,
Sent from my iPhone
On May 16, 2011, at 3:27 AM, Mauro wrote:
> On 14 May 2011 14:09, Bryan Crossland wrote:
>> Sent from my iPhone
>> On May 13, 2011, at 3:31 PM, Mauro wrote:
>>
>> On 12 May 2011 17:13, Mauro wrote:
>>
>> I have a form with some fields.
>>
>> In one of these ones the use
On May 16, 3:37 pm, Lille wrote:
> Hi,
>
> I'm converting some AR classes into modules and moving their
> attributes to whatever AR classes formerly held the association.
>
> I'm finding it hard to test these modules.
>
> I think I want to use a tableless AR model in my module tests. I just
> de
Hi folks,
Here's my basic issue, hopefully this is clear. I'm trying to submit
some UTF-8 values in my query string, but they are coming out mangled
on the other end. It *seems* like the problem is that what
Rack::Utils.unescape() pushes out gets converted to UTF-8 somewhere in
the chain (using
Has anyone tried exchanging the JSAPI token for Oauth token using
Oauth Gem?
I'm getting invalid signature error. Am I missing something?
The code snippets are available at following discussion link:
http://developer.linkedin.com/thread/3076?tstart=0#3076
--
You received this message because you
Hi,
I'm converting some AR classes into modules and moving their
attributes to whatever AR classes formerly held the association.
I'm finding it hard to test these modules.
I think I want to use a tableless AR model in my module tests. I just
define one of these -- with the attributes the module
On Mon, May 16, 2011 at 4:44 AM, jack kw wrote:
> I'm quite confuse with prawn and prawnto.
> is it must install prawn with prawnto to generate pdf ?
> what prawnto does ?
>
Prawnto adds rails support for prawn such as a template handler (.prawn). I
guess you could use prawn directly if you did
Thanks everyone, running 'gem cleanup' seems to have done the trick'!
On May 16, 4:27 am, QAS WM wrote:
> I came across the same issue couple of days ago and it seemed to be a
> problem with some of the installed gems, I had done gem cleanup and
> removed some dependent gems. A fresh install on a
On 15 May 2011 22:04, ianha wrote:
> Couldn't find a solution anywhere so I'm posting here.
>
> I'm running rvm and Ruby 1.9.2-p180 [x86_64]. I installed rails 3.0.7
> via 'gem install rails' and was running 'rails new' at command line
> without issue (Mac OS X, 10.6.6) for some time now to creat
On 14 May 2011 13:04, comopasta Gr wrote:
> Hi,
>
> So far I've let Rails and ActiveRecord rule the game. But I think
> there's some things I should change.
>
> I have a record (called Tag) that is searched by using the default auto
> incrementable Id that AR provides. On the Tag record I also kee
It is saying that mongo does not appear to be running or at least it
is not running on the machine that your script is running on or is not
running on port 27017.
Are you running mongo on your machine? It is just the same as running
MySQL or PostgreSQL in that it is an independent service. Unlike
This warning repeatedly will occurs.
/usr/local/lib/ruby/gems/1.9.1/gems/mongo-1.2.4/lib/mongo/connection.rb:469:in
`connect': Failed to connect to a master node at localhost:27017
(Mongo::ConnectionFailure)
Someone explain for this warning.Example:require rubygems and
require mongodb. But ag
On Mon, May 16, 2011 at 7:14 AM, Bryan Crossland wrote:
> On Mon, May 16, 2011 at 4:41 AM, wbsurf...@yahoo.com
> wrote:
>
>>
>>
>> I sometimes get asked about what is REST in an interview. I feel like
>> I have a sense of what it is, yet the answer seems somewhat
>> theoretical. When I built a w
On Mon, May 16, 2011 at 4:41 AM, wbsurf...@yahoo.com wrote:
>
>
> I sometimes get asked about what is REST in an interview. I feel like
> I have a sense of what it is, yet the answer seems somewhat
> theoretical. When I built a website that supported sub domains for
> rock bands, I felt I got som
So, you want to upload Files (Images, PDFs) via Ajax. Well thats not
impossible at all. We can upload files using Ajax. I have done it and it is
working quite fine for me.
Please! take a look at this tutorial. I' am sure it will helps you a lot.
http://khamsouk.souvanlasy.com/articles/ajax-file-u
Hi,
I am building a gem and I am not sure how to handle dependencies
versions.
The gem I need is ActiveSupport and I want my gem to be compatible with
version 2.3.x and 3.x.x
In my code I need the classify method from the inflector module. But
they don't work the same way in version 2.3.x ans in
[SOLVED well not solved but IMPOSSIBLE]seems cannot be done
via Ajax ... need to review my design
On 16 mai, 12:06, Erwin wrote:
> I have a simple form , with a file field
> = form_for (Clip.new), :html => {:multipart => true} , :remote =>
> true , do |f|
> = f.hidden_fi
I have a simple form , with a file field
= form_for (Clip.new), :html => {:multipart => true} , :remote =>
true , do |f|
= f.hidden_field :user_id, {:value => current_user.id}
= f.text_field :name
= f.text_area :description
= f.file_field :image
= f.su
I'm quite confuse with prawn and prawnto.
is it must install prawn with prawnto to generate pdf ?
what prawnto does ?
--
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
I sometimes get asked about what is REST in an interview. I feel like
I have a sense of what it is, yet the answer seems somewhat
theoretical. When I built a website that supported sub domains for
rock bands, I felt I got some sense of what it was, yet I was not sure
exactly how to define it in
On 15 May 2011 23:51, Carl Jenkins wrote:
> Frederick Cheung wrote in post #998691:
>> On May 14, 2:03pm, Carl Jenkins wrote:
>>> I am running ruby 1.8.7 and rails 3.0.7 on a MacPro.
>>>
>>> When I run a command - something as simple as 'gem list --local' I get a
>>> stack trace in the terminal.
ops, that was very easy...
thanks!
On May 16, 11:33 am, Chris Mear wrote:
> On 16 May 2011 09:14, johnlucas wrote:
>
>
>
>
>
>
>
>
>
> > I wonder if I am missing some conventions for the select_tag.
>
> > In fact, while the f.text_field is automatically naming the html text
> > field form_name[
On 16 May 2011 09:14, johnlucas wrote:
> I wonder if I am missing some conventions for the select_tag.
>
> In fact, while the f.text_field is automatically naming the html text
> field form_name[field_name] just using the :field_name convention,
> like:
>
>
> <%= f.label :da
Nobody here is working on an API and is concerned by this matter?
--
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
rubyo
I came across the same issue couple of days ago and it seemed to be a
problem with some of the installed gems, I had done gem cleanup and
removed some dependent gems. A fresh install on all the gems and rails
itself helped me.
hth.
Q
ianha wrote in post #998925:
> Couldn't find a solution any
On 14 May 2011 14:09, Bryan Crossland wrote:
> Sent from my iPhone
> On May 13, 2011, at 3:31 PM, Mauro wrote:
>
> On 12 May 2011 17:13, Mauro wrote:
>
> I have a form with some fields.
>
> In one of these ones the user can put data of type address, like
>
> "example street" and so on.
>
> I wan
Hi guys,
I wonder if I am missing some conventions for the select_tag.
In fact, while the f.text_field is automatically naming the html text
field form_name[field_name] just using the :field_name convention,
like:
<%= f.label :data_point_id %>
<%= f.text_
65 matches
Mail list logo