[Rails] Re: Getting strange logouts after Rails3 migration

2011-04-07 Thread Erik Lindblad
Hmm, I found out how to do it in jQuery (just use one $ instead of two) but I cannot get it to work. How should I include that in the js call to make it not log out? I have this in my controller: render :text = window.location = '#{admin_start_list_path(@competition_class.id)}'; All help

Re: [Rails] How to make Google Cache permalinks?

2011-04-07 Thread Chris Mear
On 7 April 2011 18:02, UA ritvi...@gmail.com wrote: When I create a profile at LinkedIn - the profile content is actually stored in database. When I pull page (my profile public page), I see the content. Surely the content would be being pulled form database. Yet, this public website page is

Re: [Rails] Re: rake task error

2011-04-07 Thread Bryan Crossland
On Thu, Apr 7, 2011 at 4:48 PM, Ichiro Saga li...@ruby-forum.com wrote: Thank you, Bryan. It works like a charm after adding the codes you suggested! If I run the rake task in production mode, do I need to change something in the rake file? You're welcome. :-) No need to change anything in

[Rails] Re: Routing / Controller / Model = Blog function

2011-04-07 Thread Harry Svensson
it is not really displayed one by one it's all displayed on one page linked together through javascript. -- 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

[Rails] Re: Getting strange logouts after Rails3 migration

2011-04-07 Thread Erik Lindblad
I found out how to do it. Add this to the URL: ?authenticity_token=' + encodeURIComponent('%= form_authenticity_token %) Entering here if someone else needs it. Thanks for the help, Rails community rocks as usual. /Erik On 7 Apr, 23:31, Erik Lindblad erik@gmail.com wrote: Thx, this

Re: [Rails] Route not getting recognized

2011-04-07 Thread Bryan Crossland
On Thu, Apr 7, 2011 at 4:50 PM, Luka Stolyarov li...@ruby-forum.com wrote: Hello. I have a strange issue I can't figure out: In routes.rb I create this route: map.connect('/api/v2/store/individual_offer/:offer_id', { :controller = '/api/v2/store', :action =

Re: [Rails] Could not load the bundler gem

2011-04-07 Thread Bryan Crossland
On Thu, Apr 7, 2011 at 1:32 PM, Keshav P. li...@ruby-forum.com wrote: my server after getting restarted is throwing this error : Caused by: org.jruby.exceptions.RaiseException: (RuntimeError) Could not load the bundler gem. Install it with `gem install bundler`. Apr 7, 2011 10:32:15 AM

[Rails] Re: Route not getting recognized

2011-04-07 Thread Luka Stolyarov
Works like a charm. Thanks a lot! -- 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

[Rails] Re: How to make Google Cache permalinks?

2011-04-07 Thread UA
Oh okay... and how can I promote or motivate Google to cache these specific pages better / faster? I know of some way .. in case you know of more can you please advise: Ways i know: 1. Sitemap = Generate all of these URLs for sitemap 2. Set up Google Analytics 3. Follow WAI-ARIA

[Rails] Re: Re: rake task error

2011-04-07 Thread Ichiro Saga
Bryan Crossland wrote in post #991594: You're welcome. :-) No need to change anything in file to run in production mode. A rake file will take the environment mode that the rails app is running in. If you need to run the rake file while rails is not running it's going to look for the

[Rails] Re: Textile Markup = Other formats

2011-04-07 Thread UA
Does anyone know about this? Please advise... There are any open source gems / plugins which allow 1. importing to textile from other formats 2. exporting to other formats from textile. Any help would be appreciated On Apr 7, 10:08 pm, UA ritvi...@gmail.com wrote: Hi, We were working on

Re: [Rails] Re: How to make Google Cache permalinks?

2011-04-07 Thread Walter Lee Davis
On Apr 7, 2011, at 7:28 PM, UA wrote: Oh okay... and how can I promote or motivate Google to cache these specific pages better / faster? I know of some way .. in case you know of more can you please advise: Ways i know: 1. Sitemap = Generate all of these URLs for sitemap 2. Set up Google

[Rails] Re: Unable to install Rails using Gem

2011-04-07 Thread Shafeeq
Any pointers to it? I am unable to locate the standalone packages for Rails 3. On Apr 6, 6:23 pm, Shafeeq mohamed.shaf...@gmail.com wrote: Where do I download the Gem files for Rails Version 3.0 and all its dependencies from ? Is there a documentation which describes how to do it? On Apr 6,

[Rails] text_field :first_name

2011-04-07 Thread Ad Ber
HI ALL, i am new to rails and having a hard time understanding some things.. I have a Model called person and have this code fragment in my VIew 1 %= form_for :person do |f| % 2 First name: %= f.text_field :first_name %br / 3 % end % does anybody know what :first_name means or what it does

[Rails] Can't 'rake db:migrate' keep getting dlopen mysql.bundle error

2011-04-07 Thread Dustin G.
MySQL version: 5.5.10 Ruby version: 1.8.7 Rails version: 3.0.5 I'm trying to get a Mac OS X 10.6.6. development box up and going, and I'm having problems with 'rake db:migrate.' This is how I installed the mysql gem $ sudo env ARCHFLAGS=-arch x86_64 gem install --no-rdoc --no-ri mysql --version

[Rails] eventbright gem

2011-04-07 Thread Mike Disuza
Hi, I am using eventbright gem for getting the event brite events. I am doing like as follows:- EventBright.setup(api_key) res= EventBright.call(event_search, {:latitude=37.3229978, :longitude=-122.0321823}) puts res.inspect I am getting the response as the HTTPARTY object. Can anyone tell

[Rails] Re: Rails 3 testing help with TinyMCE gem and plugin

2011-04-07 Thread M@d
Hi, I have tried your gem for rails 3. have installed it but when i loads the page it doesn't work for me? Can you please help me out. I have completed installation successfully. should i go for configuration? or there is any default configuration. Regards, Baran On Feb 24, 7:29 am, Walter

[Rails] Problem

2011-04-07 Thread Ppillo
ruby 1.9.2 rails 3.0 I have the same problem, the only diference that I have is MySQL Server 5.5, Do you think it can be the problem? -- 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

[Rails] Re: Unable to install mysql2 gem on windows 7

2011-04-07 Thread Ppillo
I make all the steps of the DEVKIT and this others steps, but my problem is when you traid to make the 10 step of the link, it show me the same error. the only diference is that my server is MySQL server 5.5

[Rails] What am I doing wrong in this nested form?

2011-04-07 Thread John Catalyne
I have these 2 models: class User ActiveRecord::Base has_one :city accepts_nested_attributes_for :city end class City ActiveRecord::Base belongs_to :user end This view: %= form_for :user,:url = users_path,:method = :post do |f| % %= f.fields_for :city_attributes do |b| % %=

[Rails] ArgumentError

2011-04-07 Thread Arne De Herdt
Hello, I'm currently getting the following error on all my requests: Started GET / for 192.168.33.82 at Thu Apr 07 00:39:29 -0700 2011 ArgumentError (wrong number of arguments (1 for 0)): I have absolutely no idea what's causing this. I'm running Rails3 from an Apache2 server on an Ubuntu

[Rails] Re: ActiveRecord::Relation

2011-04-07 Thread Tom Mac
Hi i am talking exactly about this. Now only I found this https://rails.lighthouseapp.com/projects/8994/tickets/4476-lazy-loading-broken-since-beta3 I am getting this not only in console but application also. Has anything changed in Rails3.0.5? -- Posted via

[Rails] Render partial or view with link_to

2011-04-07 Thread Sebastian
Hi, I am a Rails newbie! I have a web app for patent search. On view just shows me the details of one patent and his family. (That are just other patents connected with that patent!) My view looks like this: h1Patent

[Rails] Re: ActiveRecord::Relation

2011-04-07 Thread Frederick Cheung
On Apr 7, 8:56 am, Tom Mac li...@ruby-forum.com wrote: Hi   I have just started learning Rails3 (ruby1.92, Rails3.0.5) and watched railscast episode 202.  I tried Article.where(:hidden = true) from console. I have a confusion there since the cast says that , the above statement execute

[Rails] Re: What am I doing wrong in this nested form?

2011-04-07 Thread Frederick Cheung
On Apr 7, 8:36 am, John Catalyne li...@ruby-forum.com wrote: I have these 2 models: class User ActiveRecord::Base   has_one :city   accepts_nested_attributes_for :city end class City ActiveRecord::Base   belongs_to :user end This view: %= form_for :user,:url = users_path,:method

[Rails] Re: What am I doing wrong in this nested form?

2011-04-07 Thread John Catalyne
If I put f.fields_for :city, this gets generated: select name=user[city][id] id=user_city_id and I get an AssociationMismatch saying ActiveRecord::AssociationTypeMismatch: City(#36862620) expected, got Hash(#21169932) If I put f.fields_for :city_attributes, this gets generated: select

[Rails] Re: ActiveRecord::Relation

2011-04-07 Thread Tom Mac
Hi Fred Thanks . I tried from sample application also like def index @articles = Article.where(:hidden = true) puts @articles.inspect - end Here also the query executed. I dont know why. -- Posted via http://www.ruby-forum.com/. -- You received this message

[Rails] Re: attachment_fu thumbnails

2011-04-07 Thread Vineeth Pradhan
schaf88 wrote in post #236924: howdy! I had the problem that attachment_fu didn't make a thumbnail, but everything else worked. I read this post http://www.ruby-forum.com/topic/104213 and added a parent_id column. now I get the following error when I trie to add a photo: undefined method

[Rails] How Override naming conventions for mongodb document

2011-04-07 Thread Renuka
Model for MongoDb looks like follows class User include MongoMapper::Document key :name, String end Name of the table in MonoDb is users. How to override naming convention for MongoMapper::Document ? -- You received this message because you are subscribed to the Google Groups Ruby

[Rails] Re: No route matches error using RSpec even though route DOES match

2011-04-07 Thread Phoenix Rising
Success! Cataloging here for future Googlers -- Section 3.2 of the Rails 3 guide to routing (http:// guides.rubyonrails.org/routing.html) says, By default dynamic segments don’t accept dots – this is because the dot is used as a separator for formatted routes. If you need to use a dot within

[Rails] Re: ActiveRecord::Relation

2011-04-07 Thread Frederick Cheung
On Apr 7, 10:49 am, Tom Mac li...@ruby-forum.com wrote: Hi Fred   Thanks . I tried from sample application also like   def index     @articles = Article.where(:hidden = true)     puts @articles.inspect     -   end       Here also the query executed. I dont know why. because

[Rails] Re: What am I doing wrong in this nested form?

2011-04-07 Thread Frederick Cheung
On Apr 7, 10:43 am, John Catalyne li...@ruby-forum.com wrote: If I put f.fields_for :city, this gets generated: select name=user[city][id] id=user_city_id and I get an AssociationMismatch saying ActiveRecord::AssociationTypeMismatch: City(#36862620) expected, got Hash(#21169932) If I

[Rails] Re: Error after upgrading mysql2 gem - 0.2.7

2011-04-07 Thread Sanin Oblaster
Walter Davis wrote in post #991242: When you updated, did you install from source? Thanks for answer, problem is solved updated mysql again from installer mysql-5.5.10-osx10.6-x86_64.dmg then mysql2 gem: $ sudo gem install mysql2 --

Re: [Rails] Re: No route matches error using RSpec even though route DOES match

2011-04-07 Thread Chris Mear
On 7 Apr 2011, at 12:29, Phoenix Rising wrote: Success! Cataloging here for future Googlers -- Section 3.2 of the Rails 3 guide to routing (http:// guides.rubyonrails.org/routing.html) says, By default dynamic segments don’t accept dots – this is because the dot is used as a separator

[Rails] Re: What am I doing wrong in this nested form?

2011-04-07 Thread John Catalyne
Ignore the model names and what they stand for :). They are only for example purpose. So, if I make my view like this: %= form_for :user,:url = users_path,:method = :post do |f| % %= f.fields_for :city do |b| % %= b.collection_select :id,City.all,:id,:name % % end % div class=field

[Rails] Re: ActiveRecord::Relation

2011-04-07 Thread Frederick Cheung
On Apr 7, 1:21 pm, Tom Mac li...@ruby-forum.com wrote: Hi    Then how can I check that it is not triggering sql. I did not understand it properly. Could you explain more please? Look in your development log and ensure that you don't touch the scope - when you do anything other than adding

[Rails] Re: What am I doing wrong in this nested form?

2011-04-07 Thread Frederick Cheung
On Apr 7, 1:37 pm, John Catalyne li...@ruby-forum.com wrote: Ignore the model names and what they stand for :). They are only for example purpose. So, if I make my view like this: %= form_for :user,:url = users_path,:method = :post do |f| % Oh, for nested attributes to work you need an

[Rails] Get the time zone of the datetime object

2011-04-07 Thread Mike Disuza
Hi, I am using rails 3 for my application. My problem is that I am importing the events from meetup.com. I am getting the time of the event but I don't know from which time zone. E.g. Thu Apr 07 07:00:00 PDT I want to find out the time zone for it. Can anyone tell me how to achieve this? Thanks,

[Rails] ETag support for collections

2011-04-07 Thread Todd A. Jacobs
I was frustrated to learn that fresh_when() doesn't support Enumerable. Since I would think that the bulk of the ETag savings would be on large index actions, rather than individual show actions, I wrote a quick-and-dirty helper for application_controller.rb that I thought others might find

[Rails] Re: Need help in changing data in production.

2011-04-07 Thread Ar Chron
Marco Antonio Filho wrote in post #991464: Now comes the problem. I need to deploy these changes in the production servers. I already have the script to update the changes, but I don't know what is the conventional place to put it. Not in the migrations, I know. Why not a migration? Seems

[Rails] Re: My First Real Project

2011-04-07 Thread marco
I would suggest you to make a first prototype app that jut works with the core features you want. This prototype can have little or no front- end work, and don't worry about tests yet. You do that to quickly start to see your app, without spending efforts in details, and so you can validate your

Re: [Rails] Re: Rails suitable for highly scalable apps?

2011-04-07 Thread Peter Bell
I saw a recent posting about Twitter moving some of their code from Rails to Java and it seemed to be germane to this conversation. It is a perfect example of the kinds of things you have to do for the tiny, tiny number of sites in the world that *really* need to scale:

[Rails] Re: What am I doing wrong in this nested form?

2011-04-07 Thread Frederick Cheung
On Apr 7, 2:19 pm, John Catalyne li...@ruby-forum.com wrote: I guess it's expecting me to build the city instance in the controller? correct. field_for on an association that has nested attributes turned on renders its block for each associated object. The way I got it to work is by doing

[Rails] Refactor sorting of images

2011-04-07 Thread Clint
Hi guys, I am a bit stuck here, I know the following is damn wrong, but I couldn't figure out a cleaner solution yet. I have a bunch of images, each one has a published date and a 'liked' number. A user can click like from an image once. The index of the images can be sorted after 'liked', and

Re: [Rails] Re: Rails suitable for highly scalable apps?

2011-04-07 Thread Xavier Noria
On Thu, Apr 7, 2011 at 4:12 PM, Peter Bell pe...@pbell.com wrote: I saw a recent posting about Twitter moving some of their code from Rails to Java and it seemed to be germane to this conversation. It is a perfect example of the kinds of things you have to do for the tiny, tiny number of

[Rails] Re: What am I doing wrong in this nested form?

2011-04-07 Thread John Catalyne
But, how would having it as a virtual attribute help? It would not be saved to the database, so it's value would be lost. -- 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,

Re: [Rails] Math between different records

2011-04-07 Thread Philip Hallstrom
Could you please recommend elegant way (read - best practices in Rails way, less DB calls) to solve the following situation ? I have 2 tables: Meter - has_many :meter_records MeterRecord - belong_to :meter I have to calculate difference between meter's current month record and

[Rails] Passing NULL when it shouldn't

2011-04-07 Thread Kelly Pfaff
I'm having a problem passing along all parameters to post a comment: %= form_tag :action = comment, :id = @zwemmer, :created_on = Time.now, :created_by = number1 % %= text_area comment, body ,:size =25x10 %br/ %= submit_tag Merk op! % /form In the console i get: ←[4;36;1mComment Create

[Rails] Routing / Controller / Model = Blog function

2011-04-07 Thread Harry Svensson
Hello! I'm fairly new to coding the rails stuff - I'm however a webdesigner and I feel that I need to learn how to break rails apart once and for all. So I've spent roughly 3 hours on trying to do this on my own but with no success. My information: Rails -v = 3.0.0 Ruby -v = 1.8.7 Gem -v =

[Rails] Re: Can join tables be polymorphic?

2011-04-07 Thread Ar Chron
Andy Tolle wrote in post #991031: For example: Currently I have: functions functions_competencies competencies exams exam_competencies competencies I'd like to dry up functions_competencies and exam_competencies by using a polymorphic association, by let's say

[Rails] How to make Google Cache permalinks?

2011-04-07 Thread UA
When I create a profile at LinkedIn - the profile content is actually stored in database. When I pull page (my profile public page), I see the content. Surely the content would be being pulled form database. Yet, this public website page is cached by Google Search somehow. Example - I enter my

[Rails] Re: What am I doing wrong in this nested form?

2011-04-07 Thread Me
http://railscasts.com/episodes/16-virtual-attributes -- 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

[Rails] Re: Recording remote_ip that created a record in a nested form

2011-04-07 Thread baldmark
On Apr 1, 2:25 am, Chris Kottom ch...@chriskottom.com wrote: When a user creates a new record, it should be through a request with the nested form which is then handled by a controller somewhere in your application where you will have access to the client's IP.  You would then need to store

[Rails] Textile Markup = Other formats

2011-04-07 Thread UA
Hi, We were working on building a text editor to write articles in our rails application. Some digging and asking around - people advised us to use Textile Markup. I checked out the syntax of Textile and it was neat and concise. After that we got another Q ... is it possible to import document

[Rails] Re: Routing / Controller / Model = Blog function

2011-04-07 Thread Harry Svensson
(in routes.rb) map.connect 'A', :controller = 'B', :action = 'C' I am not the king of the djungle - but I did find this information on the web and I suppose that I make a function in controller called B and then on page A where the form is I have action='C' so they are connected - but this is

[Rails] Routing Error : No route matches / (for Hello World! action)

2011-04-07 Thread Bruce Wilson
My routes.rb reads at the top: Hello::Application.routes.draw do match ':controller(/:action(/:id(.:format)))' and then all the commented material it comes with and an end at the end of the file. But when I type http://localhost:3000 into my browser I get the following error message: Routing

[Rails] rake task error

2011-04-07 Thread Ichiro Saga
Hi, guys. I wrote a rake task that called a method in model A. in app.rake task :update_number = :environment do A.update_method end in model A def self.update_method t1 = A.find.all ... .. end When I ran the rake task, it returned an error undefined local variable or

[Rails] Could not load the bundler gem

2011-04-07 Thread Keshav P.
my server after getting restarted is throwing this error : Caused by: org.jruby.exceptions.RaiseException: (RuntimeError) Could not load the bundler gem. Install it with `gem install bundler`. Apr 7, 2011 10:32:15 AM org.apache.catalina.core.ApplicationContext log SEVERE: Application Error Can

Re: [Rails] ArgumentError

2011-04-07 Thread Bryan Crossland
On Thu, Apr 7, 2011 at 2:41 AM, Arne De Herdt li...@ruby-forum.com wrote: Hello, I'm currently getting the following error on all my requests: Started GET / for 192.168.33.82 at Thu Apr 07 00:39:29 -0700 2011 ArgumentError (wrong number of arguments (1 for 0)): I have absolutely no idea

[Rails] Re: What am I doing wrong in this nested form?

2011-04-07 Thread Frederick Cheung
On Apr 7, 4:57 pm, John Catalyne li...@ruby-forum.com wrote: But, how would having it as a virtual attribute help? It would not be saved to the database, so it's value would be lost. because you'd define city_id= to be basically the same as the city_attributes method you have above. It's not

[Rails] Re: Routing / Controller / Model = Blog function

2011-04-07 Thread Frederick Cheung
On Apr 7, 6:25 pm, Harry Svensson li...@ruby-forum.com wrote: (in routes.rb) map.connect 'A', :controller = 'B', :action = 'C' I am not the king of the djungle - but I did find this information on the web and I suppose that I make a function in controller called B and then on page A where

[Rails] Re: Routing Error : No route matches / (for Hello World! action)

2011-04-07 Thread Frederick Cheung
On Apr 7, 6:51 pm, Bruce Wilson bwilson...@yahoo.com wrote: My routes.rb reads at the top: Hello::Application.routes.draw do   match ':controller(/:action(/:id(.:format)))' and then all the commented material it comes with and an end at the end of the file. But when I

[Rails] adding an item to a list of wishes - noobie question on link_to helper

2011-04-07 Thread pizu
Hi, I'm a new kid here. Hello! Have a question, regarding my favourite web framework: I have a User, Item and Wish models. User have many Items and Wishes Item have many Wishes Wish belongs to User and Item ItemsController def show @item = Item.find(params[:id]) end WishesController

[Rails] Re: Routing Error : No route matches / (for Hello World! action)

2011-04-07 Thread mainguy
I don't see that you've routed anything to the '/' path. Your route requires the controller to be in the path. First step would be to uncomment this # You can have the root of your site routed with root # just remember to delete public/index.html. # root :to = welcome#index replacing

[Rails] Re: How to make Google Cache permalinks?

2011-04-07 Thread mainguy
If you're asking how to get this info into google http://www.google.com/support/webmasters/bin/answer.py?answer=35291 Typically you're going to need to have links on a page to enable crawling the content. OR you're going to need to link back to your site from other sites. I'm not sure how

[Rails] How to display the list of children as links under their respective parent

2011-04-07 Thread railer helper
Hey.Does nybody know how to display a list(array) as links Eg: I've a @products and @categories enumerable objects supplied to the view from a single CategoryController ... I want to show the products under their respective categories as links and get rid of the separate show page for

[Rails] Match path without controller.

2011-04-07 Thread Ivan K.
Hi. I wanna do something like that: match '/system/videos/:id/original/snapshot.jpg', :as = :snapshot So i could do snapshot_path(id) in my views. Currently i implemented it as a Helper Method. Is there any way to match path without controller? -- You received this message because you are

Re: [Rails] Get the time zone of the datetime object

2011-04-07 Thread Colin Law
On 7 April 2011 14:08, Mike Disuza li...@ruby-forum.com wrote: Hi, I am using rails 3 for my application. My problem is that I am importing the events from meetup.com. I am getting the time of the event but I don't know from which time zone. E.g. Thu Apr 07 07:00:00 PDT I want to find out

[Rails] Getting strange logouts after Rails3 migration

2011-04-07 Thread Erik Lindblad
Hi I recently migrated a Rails 2 app to Rails 3 and switched to Devise in the process. It is working well apart from one strange phenomenon. When I do redirects using javascript the user is logged out. Has anyone experienced something similar? Kindest regards Erik Lindblad -- You received

Re: [Rails] How to display the list of children as links under their respective parent

2011-04-07 Thread Michael Pavling
On 7 April 2011 19:37, railer helper railerhel...@gmail.com wrote:                          % @categories.each do |cat| %                           th  %=  link_to( cat.name, cat) %/th                        % cat.products.each do |product| %                        trtd %=

Re: [Rails] Re: Rails suitable for highly scalable apps?

2011-04-07 Thread Bryan Crossland
On Thu, Apr 7, 2011 at 10:12 AM, Xavier Noria f...@hashref.com wrote: On Thu, Apr 7, 2011 at 4:12 PM, Peter Bell pe...@pbell.com wrote: I saw a recent posting about Twitter moving some of their code from Rails to Java and it seemed to be germane to this conversation. It is a perfect

Re: [Rails] Passing NULL when it shouldn't

2011-04-07 Thread Bryan Crossland
On Thu, Apr 7, 2011 at 11:12 AM, Kelly Pfaff li...@ruby-forum.com wrote: I'm having a problem passing along all parameters to post a comment: %= form_tag :action = comment, :id = @zwemmer, :created_on = Time.now, :created_by = number1 % %= text_area comment, body ,:size =25x10 %br/ %=

Re: [Rails] rake task error

2011-04-07 Thread Bryan Crossland
On Thu, Apr 7, 2011 at 12:58 PM, Ichiro Saga li...@ruby-forum.com wrote: Hi, guys. I wrote a rake task that called a method in model A. in app.rake task :update_number = :environment do A.update_method end in model A def self.update_method t1 = A.find.all ... .. end

Re: [Rails] Getting strange logouts after Rails3 migration

2011-04-07 Thread Paul
Yes, the problem is the authenticity token needs to be passed along with your data. There are various ways of doing this depending on your js library. Here's how to access the data you need using prototype: var csrf_param = $$('meta[name=csrf-param]')[0].content; var csrf_token =

[Rails] Re: Routing Error : No route matches / (for Hello World! action)

2011-04-07 Thread Bruce Wilson
On Apr 7, 11:17 am, mainguy mike.main...@gmail.com wrote: I don't see that you've routed anything to the '/' path. Your route requires the controller to be in the path. First step would be to uncomment this  # You can have the root of your site routed with root   # just remember to delete

[Rails] Re: Routing Error : No route matches / (for Hello World! action)

2011-04-07 Thread Frederick Cheung
On Apr 7, 10:02 pm, Bruce Wilson bwilson...@yahoo.com wrote: On Apr 7, 11:17 am, mainguy mike.main...@gmail.com wrote: I don't see that you've routed anything to the '/' path. Your route requires the controller to be in the path. First step would be to uncomment this  # You can

[Rails] Re: Getting strange logouts after Rails3 migration

2011-04-07 Thread Erik Lindblad
Thx, this really made my day, having somewhere to start. Do you know how to do it from jquery? Regards Erik On 7 Apr, 22:59, Paul p...@nines.org wrote: Yes, the problem is the authenticity token needs to be passed along with your data. There are various ways of doing this depending on your

[Rails] Re: Routing Error : No route matches / (for Hello World! action)

2011-04-07 Thread Bruce Wilson
On Apr 7, 2:16 pm, Frederick Cheung frederick.che...@gmail.com wrote: On Apr 7, 10:02 pm, Bruce Wilson bwilson...@yahoo.com wrote: On Apr 7, 11:17 am, mainguy mike.main...@gmail.com wrote: I don't see that you've routed anything to the '/' path. Your route requires the controller

[Rails] Re: rake task error

2011-04-07 Thread Ichiro Saga
Thank you, Bryan. It works like a charm after adding the codes you suggested! If I run the rake task in production mode, do I need to change something in the rake file? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby

[Rails] Route not getting recognized

2011-04-07 Thread Luka Stolyarov
Hello. I have a strange issue I can't figure out: In routes.rb I create this route: map.connect('/api/v2/store/individual_offer/:offer_id', { :controller = '/api/v2/store', :action = :individual_offer , }) Then, in the view I generate a url in this way: