Re: [Rails] Re: Rails association not working. "Undefined method" error in trying to access child object from pa
On 9 April 2012 06:27, Vikram A. wrote: > Hi Colin, > > The error here is not the issue, I have rectified it. My point is having > declared the associations properly with belongs_to, has_many...when in > the console I don't get any association methods. I should be able to > access child object from parent object based on these declarations, but > continues to show 'undefined method'. You have not quoted the previous message so I have not idea what this message is about. Remember this is a mailing list not a forum. Please post the exact error you are seeing (copy/paste it here from the console if you are seeing it in the console) and post the relevant sections of code also (the association definitions if it seems to be a problem with them). Colin -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Rails association not working. "Undefined method" error in trying to access child object from pa
Hi Colin, The error here is not the issue, I have rectified it. My point is having declared the associations properly with belongs_to, has_many...when in the console I don't get any association methods. I should be able to access child object from parent object based on these declarations, but continues to show 'undefined method'. Thanks! -- 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 email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] whenever cron is not working with rails-3
I'm using Whenever for the first time. My cron is not working on the production server. I m using rails-3.1.2 In my schedule.rb file every :hour do # Many shortcuts available: :hour, :day, :month, :year, :reboot runner "Report.create_report", :environment=>"development" end every 2.minutes do runner "Report.create_report2" , :environment=>"development" end In my Report model file def self.create_report r = Report.new r.ad_network_campaign_id =1 r.ad_network_campaign_name=2 r.save end def self.create_report2 r = Report.new r.ad_network_campaign_id =5 r.ad_network_campaign_name=5 r.save end After this I run the command whenever --update-crontab In my crontab crontab -l # Begin Whenever generated tasks for: jigserv 0 * * * * /bin/bash -l -c 'cd /var/www/jigserv && script/rails runner -e production '\''Report.create_report'\''' 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * * /bin/bash -l -c 'cd /var/www/jigserv && script/rails runner -e production '\''Report.create_report2'\''' # End Whenever generated tasks for: jigserv In the last my data is not inserted in the Report table as I want. -- 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 email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] How I update Multi Tables In A Form
Hello Friend!. I wanna update tables in a forms. I have two table 1. user table ( usertable has id , name, email, address) 2. game table (gametable has id, description, game_date, gametiming , user_id) for edit .. I can display all two table data... Wanna update data params by userID. I do update two table data in a form. How I do it ? Give Me A Hand! phoesan -- 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 email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Rails Payment Gateway Solutions
Okay, I can now provide feedback on Stripe. First, there is an easy to follow Railscasts tutorial by Ryan Bates which covers how to implement Stripe. However, this tutorial is meant for recurring based subscriptions and does not cover regular charge objects (single payments). So, you have to review the API at stripe.com to understand how to do things. The main points that I can cover are that you have three types of transaction objects that you will work with when using Stripe. These are: Token Object (credit card) Customer Object (your customer) Charge Object (can use the token or the customer) If you are doing recurring subscriptions you are working with tokens, customers, and plans. If you are doing single charges you work with tokens and charges. The entire setup is pretty easy to follow and I was able to get it incorporated into my site for both html and mobile views (jQuery Mobile) in under 2 days. The Good: Stripe.com handles the SSL encryption for sales and is PCI Service Provider Level 1, which means they have the most stringent level of certification available. They also allow you to use PGP for site to site encryption if you want to go that far in your communications from end to end. The Bad: Even though you aren't handling the cards themselves they appear to be adamant about requiring to have SSL on your site. This is a hefty fee for some and bothers me because I don't want to handle SSL or keep credit card information on my site at all. I do not believe if they enforce you to have SSL or if they strongly just recommend it. I would think that you could still use a non-SSL site and communicate with PGP for security. I've emailed them and am waiting for more information. They also have a $15 dollar service fee for chargebacks. This means if you sell a virtual good on your site for say $.99 cents and a customer disputes this, regardless of whether or not you win the dispute, you pay $15 dollars. If you have 1,000 charges of $.99 cents and 20% of the customers dispute the transaction this means you have earned roughly $800 dollars and spent $3000 dollars. I do not like this type of fee as paypal does not have a $15 dollar charge back fee. I suppose you can get around this by having a strong refund policy because refunds are free from Stripe's point of view. They also have a nice control panel that you can handle the refunds if you want to do this manually. I hope some of this information helps. -- 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 email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Rails Payment Gateway Solutions
Does anyone have any feedback on Stripe? Thanks for raising this, very useful. -- 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 email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Ideas on a project or gem to develop
Hi, If You develop a helpdesk in Rails, i will help you. Somebody to develop a "Mantis On Rails"? El domingo 8 de abril de 2012, Linus Pettersson escribió: > Thank you for your idea! Will keep that in mind. > > Any other ideas? > > > > Den torsdagen den 5:e april 2012 kl. 20:02:30 UTC+2 skrev Alexandru Emil > Lupu: >> >> Hello! >> >> >> What i do need would be a nice "HelpDesk" gem. I haven't seen one that i >> could just install it ... and work ... >> >> I need it, so, i am gonna start coding... If there are any of you who >> would like to share any ideas or work about this idea, I'd be happy to >> listen your needs. >> >> Linus, I hope i did not "steal" your topic, and i hope I've given you a >> project idea, and i'd be happy to help. >> >> Alecs >> >> >> On Apr 5, 2012, at 7:20 PM, Linus Pettersson wrote: >> >> ity student (Masters) and this summer I will probably not have an >> ordinary summer job, but instead work on some of my own projects. These >> will probably not fill my time so now I want some ideas for a project to >> start or a gem to develop in Rails. >> >> Do you have any service you'd like to see that you can make use of? >> Any gem you'd like someone to develop that you think a lot of people >> needs? >> >> The main reason for this is to learn Ruby and Rails better, not to make >> money. I've never developed a gem before and it's always more fun to create >> something real and useful! >> >> So, hit me with some nice ideas! :) >> >> Regards >> >> >> > Den torsdagen den 5:e april 2012 kl. 20:02:30 UTC+2 skrev Alexandru Emil > Lupu: >> >> Hello! >> >> >> What i do need would be a nice "HelpDesk" gem. I haven't seen one that i >> could just install it ... and work ... >> >> I need it, so, i am gonna start coding... If there are any of you who >> would like to share any ideas or work about this idea, I'd be happy to >> listen your needs. >> >> Linus, I hope i did not "steal" your topic, and i hope I've given you a >> project idea, and i'd be happy to help. >> >> Alecs >> >> >> On Apr 5, 2012, at 7:20 PM, Linus Pettersson wrote: >> >> ity student (Masters) and this summer I will probably not have an >> ordinary summer job, but instead work on some of my own projects. These >> will probably not fill my time so now I want some ideas for a project to >> start or a gem to develop in Rails. >> >> Do you have any service you'd like to see that you can make use of? >> Any gem you'd like someone to develop that you think a lot of people >> needs? >> >> The main reason for this is to learn Ruby and Rails better, not to make >> money. I've never developed a gem before and it's always more fun to create >> something real and useful! >> >> So, hit me with some nice ideas! :) >> >> Regards >> >> >> > Den torsdagen den 5:e april 2012 kl. 20:02:30 UTC+2 skrev Alexandru Emil > Lupu: >> >> Hello! >> >> >> What i do need would be a nice "HelpDesk" gem. I haven't seen one that i >> could just install it ... and work ... >> >> I need it, so, i am gonna start coding... If there are any of you who >> would like to share any ideas or work about this idea, I'd be happy to >> listen your needs. >> >> Linus, I hope i did not "steal" your topic, and i hope I've given you a >> project idea, and i'd be happy to help. >> >> Alecs >> >> >> On Apr 5, 2012, at 7:20 PM, Linus Pettersson wrote: >> >> ity student (Masters) and this summer I will probably not have an >> ordinary summer job, but instead work on some of my own projects. These >> will probably not fill my time so now I want some ideas for a project to >> start or a gem to develop in Rails. >> >> Do you have any service you'd like to see that you can make use of? >> Any gem you'd like someone to develop that you think a lot of people >> needs? >> >> The main reason for this is to learn Ruby and Rails better, not to make >> money. I've never developed a gem before and it's always more fun to create >> something real and useful! >> >> So, hit me with some nice ideas! :) >> >> Regards >> >> >> > Den torsdagen den 5:e april 2012 kl. 20:02:30 UTC+2 skrev Alexandru Emil > Lupu: >> >> Hello! >> >> >> What i do need would be a nice "HelpDesk" gem. I haven't seen one that i >> could just install it ... and work ... >> >> I need it, so, i am gonna start coding... If there are any of you who >> would like to share any ideas or work about this idea, I'd be happy to >> listen your needs. >> >> Linus, I hope i did not "steal" your topic, and i hope I've given you a >> project idea, and i'd be happy to help. >> >> Alecs >> >> >> On Apr 5, 2012, at 7:20 PM, Linus Pettersson wrote: >> >> ity student (Masters) and this summer I will probably not have an >> ordinary summer job, but instead work on some of my own projects. These >> will probably not fill my time so now I want some ideas for a project to >> start or a gem to develop in Rails. >> >> Do you have any service you'd like to see that you can make use of? >> Any gem you'd like someone to develop that you think a lot of pe
RESOLVED Re: [Rails] Can't get debugger to work on MacOS X Lion/Rails 3.2/Ruby 1.9.3
> On Saturday, April 7, 2012 9:57:52 PM UTC-7, @1337807 wrote: >> >> I've been having similar issues. There is apparently a fork of the >> project called simply 'debugger' as the original ruby-debug seems to have >> been abandoned (heresay). >> >> Let me know if you find a solution; debugger didn't work for me, but it >> is likely that my system is borked uniquely as most I know have no trouble. >> > Do you have a link to this fork? As one might imagine, googling for "ruby > debugger" mostly comes up with ruby-debug. > I managed to find it by searching for "ruby-debug19 fork debugger"; the github repository is here: https://github.com/cldwalker/debugger I did as directed and added the gem to my Gemfile, ran bundle install, and now I'm debugging! Thanks for the pointer, @1337807! -David -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/Ig7rYCJcdfcJ. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: sqlite3-ruby is invalid?
Thank up Walter. Think I looked at that line a hundred times. I know it had to work - it work all along. Thanks again Jeff On Apr 6, 1:40 pm, Walter Lee Davis wrote: > On Apr 6, 2012, at 3:37 PM, Jeff Kyzer wrote: > > > > > > > > > > > Hello > > I have been learning ruby on rails 3 from the Michael hartl book, and > > I have run into something that I can't figure out. After updating the > > gem file and running bundle install, I am getting the following error > > > You passed :required as an option for gem 'sqlite3-ruby', but it is > > invalid. > > > Here is the gem file code. Below this is what I added. Can anyone > > tell me why I am getting this error? > > > Thanks > > > source 'https://rubygems.org' > > > gem 'rails', '3.2.0' > > gem 'sqlite3-ruby', '1.2.5', :required => 'sqlite3' > > > group :development do > > gem 'rspec-rails', '2.0.1' > > end > > > group :test do > > gem 'rspec', '2.0.1' > > gem 'webrat', '0.7.1' > > end > > > # Bundle edge Rails instead: > > # gem 'rails', :git => 'git://github.com/rails/rails.git' > > > gem 'sqlite3' > > > # Gems used only for assets and not required > > # in production environments by default. > > > Here is the stuff I added > > > gem 'sqlite3-ruby', '1.2.5', :required => 'sqlite3' > > make that :require not :required and this should work. > > Walter > > > > > > > > > > > group :development do > > gem 'rspec-rails', '2.0.1' > > end > > > group :test do > > gem 'rspec', '2.0.1' > > gem 'webrat', '0.7.1' > > end > > > -- > > 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+unsubscr...@googlegroups.com. > > For more options, visit this group > > athttp://groups.google.com/group/rubyonrails-talk?hl=en. -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: Re: web to show locate folder
Thanks, I try to file search on local folder, but it still can't work. it will show this error No route matches [POST] "/downloadfile/search" but I had add "get 'downloadfile/search' " into routes.rb How to fix the problems? html.erb file <%= form_tag :controller =>'downloadfile', :action=>'search', :method => 'get' do %> <%= text_field_tag :search_name, params[:search_name]%> <%= submit_tag "Search", :name=> nil %> <%= link_to_function "Clear", "$('search_field').clear"%> <% end %> Thanks, Colin Law 於 2012年4月7日上午2:44 寫道: > On 6 April 2012 17:40, C.C Chen wrote: > > Thanks, > > > > But my folder all are txt file(not html), just want they can show by web > > interface. > > > > If I choose test.txt , test.txt content will show on web site right away. > > If you put the file in the public folder and open it with the browser > (http://localhost:3000/test.txt) it will probably display in the > browser (dependent on how the browser is setup), but that is nothing > at all to do with rails so this is not the right place to ask. > > Colin > > > > > > > Could you give me some suggestion? > > > > > > > > Thanks, > > > > > > Colin Law 於 2012年4月6日下午8:22 寫道: > >> > >> On 6 April 2012 12:06, CC Chen wrote: > >> > Colin Law wrote in post #1055252: > >> >> On 6 April 2012 11:42, CC Chen wrote: > >> >>> > >> >>> > >> >>> Sorry, it is 'local folder'. > >> >>> > >> >>> > >> >>> I want to select a file and it can show the context on web directly. > >> >> > >> >> Still not enough information I am afraid. Local to who? The server > >> >> or the client? Please give an example of exactly what you want to > do, > >> >> it will save us both a lot of typing. > >> >> > >> >> Colin > >> > > >> > > >> > > >> > Local I means those files saved on my server disk. > >> > > >> > (My database not ready) > >> > > >> > And I want to display the contents which I choose by using web > >> > interface. > >> > >> Just put the files in the public folder of your rails app, then they > >> can be accessed directly. So if your app is accessed via > >> http://localhost:3000 then a file public/test.html can be fetched by > >> http://localhost:3000/test.html. > >> > >> Colin > >> > >> -- > >> 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+unsubscr...@googlegroups.com. > >> For more options, visit this group at > >> http://groups.google.com/group/rubyonrails-talk?hl=en. > >> > > > > -- > > 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+unsubscr...@googlegroups.com. > > For more options, visit this group at > > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > -- > gplus.to/clanlaw > > -- > 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+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Can't get debugger to work on MacOS X Lion/Rails 3.2/Ruby 1.9.3
On Saturday, April 7, 2012 9:57:52 PM UTC-7, @1337807 wrote: > > I've been having similar issues. There is apparently a fork of the project > called simply 'debugger' as the original ruby-debug seems to have been > abandoned (heresay). > > Let me know if you find a solution; debugger didn't work for me, but it is > likely that my system is borked uniquely as most I know have no trouble. > Do you have a link to this fork? As one might imagine, googling for "ruby debugger" mostly comes up with ruby-debug. -David -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/ElRrgScLX1cJ. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Can't get debugger to work on MacOS X Lion/Rails 3.2/Ruby 1.9.3
On Sunday, April 8, 2012 1:24:05 AM UTC-7, tom meinlschmidt wrote: > > > try $ RUBYOPT='-r openssl' bundle exec rspec -d > spec/controllers/seasons_controller_spec.rb > > it looks weird but usually works :) > Nope, got the same error... -D -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/XUBv3ygMzhAJ. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] WEBrick setup
On 04/08/2012 05:37 AM, CC Chen wrote: Hi all, I want to start my rails server by WEBrick. How to set the WEBrick up for production? (not http://localhost:3000) I want others can link to my web server. If you want webrick to operate on another port for some reason use the -p option script/server webrick -p portnumber (for ROR 2.x) On Linux/Unix based systems low numbered ports will require you to run as root. Not a good option. If on Linux/Unix use apache2 or nginx + passenger instead of webrick. If on Windows you can use webrick or mongrel though I think mongrel is a better choice. 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] custom query to db
On Sun, Apr 8, 2012 at 3:34 AM, Aashish Kiran wrote: > There are 2 models 'user' and 'interests' > Association between them is has_and_belongs_to_many > > Now If I want to list common interests between two users. How do I query > db. > I think, we have to write custom plsql statement. ?! user1.interests and user2.interests are just arrays. You don't need a SQL statement to figure out the intersection of two arrays. :-) -- Hassan Schroeder hassan.schroe...@gmail.com http://about.me/hassanschroeder twitter: @hassan -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] WEBrick setup
On 8 April 2012 13:37, CC Chen wrote: > Hi all, > > > I want to start my rails server by WEBrick. > > How to set the WEBrick up for production? (not http://localhost:3000) > > I want others can link to my web server. Do you mean on the internet or just on your local network? If you mean your local network they can probably access it by http://your_pc_IP_address:3000 just running webrick. If you mean on the intranet then have a look at Heroku. Colin > > > > > > Thanks, > > -- > 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 email to > rubyonrails-talk+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > -- gplus.to/clanlaw -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Upgrading to Rails 3
Quoting Gurdipe Dosanjh : > Hi All, > > Thanks to everyone for the great updates on how to upgrade to Rails 3. > > What are the technical and business benefits of upgrading to the latest > versions of Ruby an Ruby on Rails. > > The application we have written is still on Ruby version 1.8.7 and Ruby on > Rails version 2.3.5 There are no bug or security fixes for 2.x. Nor if I understand the policy correctly, 3.0.x. I'd suggest moving to 2.3.14 first before jumping to 3.x. Jeffrey -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] WEBrick setup
Hi all, I want to start my rails server by WEBrick. How to set the WEBrick up for production? (not http://localhost:3000) I want others can link to my web server. Thanks, -- 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 email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Rails association not working. "Undefined method" error in trying to access child object from parent object
On 6 April 2012 20:25, Vikram Anand wrote: > For some reason (most likely in my view due to naming conventions) rails > association is not working. Trying to access child object from parent object > gives undefined method. > > ... > Sns::Application.routes.draw do > root :to => "questions#index" > resources :questions do > resources :question_responses > end > > > question.rb: > > class Question < ActiveRecord::Base > validates :title, :presence => true > validates :description, :presence => true > > has_many :question_responses, :dependent => :destroy, :class_name => > "QuestionResponse" > accepts_nested_attributes_for :question_responses, :allow_destroy => true > end > > > question_response.rb: > > class QuestionResponse < ActiveRecord::Base > validates :body, :presence => true > belongs_to :question, :foreign_key => "question_id" > end > > > questions_controller.rb: > > class QuestionsController < ApplicationController > before_filter :find_question > before_filter :find_question_response, :only => [:show, :edit, :update, > :destroy] > > def index > @question = Question.new > @questions = Question.all > end > > def new > @question = Question.new > @question_response = @question.question_responses.build > end > > def create > @question = Question.new(params[:question]) > > if @question.save > flash[:notice] = "Question has been created." > redirect_to @question > else > flash[:alert] = "Question has not been created." > render :action => 'new' > end > > @question_response = > @question.question_responses.build(params[:question_response]) > if @question_response.save > flash[:notice] = "Reply has been created." > redirect_to [@question, @question_response] > else > flash[:alert] = "Reply has not been created." > render "question_responses/new" > end > end > > def show > @question = Question.find(params[:id]) > end > > def edit > @question = Question.find(params[:id]) > end > > def update > @question = Question.find(params[:id]) > > if @question.update_attributes(params[:question]) > flash[:notice] = "Question has been updated." > redirect_to @question > else > flash[:alert] = "Question has not been updated." > render :action => 'edit' > end > end > > def destroy > @question = Question.find(params[:id]) > @question.destroy > flash[:notice] = "Question has been deleted." > redirect_to questions_path > end > > def find_question_response > @question_response = @question.question_responses.find(params[:id]) > end > > private > def find_question > if (params[:question_response] && > params[:question_response][:question_id]) > @question = Question.find(params[:question_response][:question_id]) > elsif params[:question_id] > @question = Question.find(params[:question_id]) > end > end > end > > > Error with trace: > > undefined method `question_responses' for nil:NilClass > > app/controllers/questions_controller.rb:55:in `find_question_response' Read the error carefully, it says that nil has not got a method question_responses, so the object you are trying to call the method on is nil. So apparently @question is nil, assuming that line 55 is @question_response = @question.question_responses.find(params[:id]) The reason is that this is being called in a before_filter and you have not got any code there to setup @question. Colin -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Ideas on a project or gem to develop
Thank you for your idea! Will keep that in mind. Any other ideas? Den torsdagen den 5:e april 2012 kl. 20:02:30 UTC+2 skrev Alexandru Emil Lupu: > > Hello! > > > What i do need would be a nice "HelpDesk" gem. I haven't seen one that i > could just install it ... and work ... > > I need it, so, i am gonna start coding... If there are any of you who > would like to share any ideas or work about this idea, I'd be happy to > listen your needs. > > Linus, I hope i did not "steal" your topic, and i hope I've given you a > project idea, and i'd be happy to help. > > Alecs > > > On Apr 5, 2012, at 7:20 PM, Linus Pettersson wrote: > > ity student (Masters) and this summer I will probably not have an ordinary > summer job, but instead work on some of my own projects. These will > probably not fill my time so now I want some ideas for a project to start > or a gem to develop in Rails. > > Do you have any service you'd like to see that you can make use of? > Any gem you'd like someone to develop that you think a lot of people needs? > > The main reason for this is to learn Ruby and Rails better, not to make > money. I've never developed a gem before and it's always more fun to create > something real and useful! > > So, hit me with some nice ideas! :) > > Regards > > > Den torsdagen den 5:e april 2012 kl. 20:02:30 UTC+2 skrev Alexandru Emil Lupu: > > Hello! > > > What i do need would be a nice "HelpDesk" gem. I haven't seen one that i > could just install it ... and work ... > > I need it, so, i am gonna start coding... If there are any of you who > would like to share any ideas or work about this idea, I'd be happy to > listen your needs. > > Linus, I hope i did not "steal" your topic, and i hope I've given you a > project idea, and i'd be happy to help. > > Alecs > > > On Apr 5, 2012, at 7:20 PM, Linus Pettersson wrote: > > ity student (Masters) and this summer I will probably not have an ordinary > summer job, but instead work on some of my own projects. These will > probably not fill my time so now I want some ideas for a project to start > or a gem to develop in Rails. > > Do you have any service you'd like to see that you can make use of? > Any gem you'd like someone to develop that you think a lot of people needs? > > The main reason for this is to learn Ruby and Rails better, not to make > money. I've never developed a gem before and it's always more fun to create > something real and useful! > > So, hit me with some nice ideas! :) > > Regards > > > Den torsdagen den 5:e april 2012 kl. 20:02:30 UTC+2 skrev Alexandru Emil Lupu: > > Hello! > > > What i do need would be a nice "HelpDesk" gem. I haven't seen one that i > could just install it ... and work ... > > I need it, so, i am gonna start coding... If there are any of you who > would like to share any ideas or work about this idea, I'd be happy to > listen your needs. > > Linus, I hope i did not "steal" your topic, and i hope I've given you a > project idea, and i'd be happy to help. > > Alecs > > > On Apr 5, 2012, at 7:20 PM, Linus Pettersson wrote: > > ity student (Masters) and this summer I will probably not have an ordinary > summer job, but instead work on some of my own projects. These will > probably not fill my time so now I want some ideas for a project to start > or a gem to develop in Rails. > > Do you have any service you'd like to see that you can make use of? > Any gem you'd like someone to develop that you think a lot of people needs? > > The main reason for this is to learn Ruby and Rails better, not to make > money. I've never developed a gem before and it's always more fun to create > something real and useful! > > So, hit me with some nice ideas! :) > > Regards > > > Den torsdagen den 5:e april 2012 kl. 20:02:30 UTC+2 skrev Alexandru Emil Lupu: > > Hello! > > > What i do need would be a nice "HelpDesk" gem. I haven't seen one that i > could just install it ... and work ... > > I need it, so, i am gonna start coding... If there are any of you who > would like to share any ideas or work about this idea, I'd be happy to > listen your needs. > > Linus, I hope i did not "steal" your topic, and i hope I've given you a > project idea, and i'd be happy to help. > > Alecs > > > On Apr 5, 2012, at 7:20 PM, Linus Pettersson wrote: > > ity student (Masters) and this summer I will probably not have an ordinary > summer job, but instead work on some of my own projects. These will > probably not fill my time so now I want some ideas for a project to start > or a gem to develop in Rails. > > Do you have any service you'd like to see that you can make use of? > Any gem you'd like someone to develop that you think a lot of people needs? > > The main reason for this is to learn Ruby and Rails better, not to make > money. I've never developed a gem before and it's always more fun to create > something real and useful! > > So, hit me with some nice ideas! :) > > Regards > > > -- You received this me
[Rails] Re: Agile Web Development 4th ed. - Can't mass assign.error
On Apr 8, 3:11 am, "Lucas J." wrote: > Thanks, Jeffrey. I just wanted to ensure that I was on the right track > and that I wasn't setting myself up for more problems later. > > Tom - I tried google first (I always do). My attributes are already set > to attr_accessible in my models (there are only three at this point), > which is why I was so confused. I'm sure there's something I'm > overlooking but I'm not going to spend too much more time on it since I > have a working solution at this point. > If you want to be able to do line_items.build(product: p) you need to mark product as attr_accessible too. The mass assignment stuff doesn't know what things are database attributes, virtual attributes, associations etc. Fred > -- > Posted viahttp://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 email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] REST Services from PHP
Hi, I want to read data from Rails 3.1 app with PHP. I use REST with JSON for this. My problem is that Rails app have "devise" and "cancan" and i don't want access to REST Services because i haven't auth previously. Any example of this? Thanks and sorry for my english. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/GekRzRnedXoJ. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Rails Developer Needed (Telecommute Only)
I'm building a Rails-driven social selling Website - more details will be provided after signing a non-disclosure agreement. I'm looking for a Rails developer with experience in Rails 3.1+, jQuery, Solr/Sphinx/other search, MySQL, testing, and other goodies that come with Rails/Ruby development. This person will collaborate with me and other developers to finish building the site (it's 50% done); this position is telecommute and freelance for now, but you may be asked to work full-time (likely still telecommute) in the future. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/8Wok_PcHOKoJ. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] custom query to db
Hi all, I have problem regarding querying database in rails database. Senerio: There are 2 models 'user' and 'interests' Association between them is has_and_belongs_to_many Now If I want to list common interests between two users. How do I query db. I think, we have to write custom plsql statement. Can I know your thoughts. Thank you, Aashish -- 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 email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: Re: [Rails] Upgrading to Rails 3
Hi All, Thanks to everyone for the great updates on how to upgrade to Rails 3. What are the technical and business benefits of upgrading to the latest versions of Ruby an Ruby on Rails. The application we have written is still on Ruby version 1.8.7 and Ruby on Rails version 2.3.5 Kind Regards and Thanks in advance Gurdipe On 8 April 2012 09:25, Gurdipe Dosanjh wrote: > Hi Jodi, > > Thanks for this great point about testing and plugins that need to be > upgraded. Its really helpful > > Kind Regards > > Gurdipe > > On 7 April 2012 15:30, Jodi Showers wrote: > >> I suggest you get your tests in gear if not already >> >> get a core group (start with models, then controllers, minimum of models) >> passing in 2.3.5 >> >> then upgrade >> >> you'll find a great number of plugins and gems will need to be upgraded - >> and some will have to be hand patched if you cannot find a suitable >> replacement >> Jodi >> >> On 2012-04-07, at 9:08 AM, Jeffrey L. Taylor wrote: >> >> > Quoting Gurdipe Dosanjh : >> >> Hi All, >> >> >> >> Re: Upgrading to Rails 3 >> >> >> >> I am working on a rails application I need to upgrade to the latest >> version >> >> of Ruby and Ruby on Rails. >> >> >> >> It is currently using: >> >> >> >> Ruby version 1.8.7 and >> >> Ruby on Rails version 2.3.5 >> >> >> >> Is there any information, tutorial, guides etc. I can follow >> >> >> >> Any help would be greatly appreciated >> >> >> > >> > In addition to the other advice, overriding ActiveRecord callbacks was >> > deprecated in 2.3.8. So replace >> > >> > def before_save >> > # whatever >> > end >> > >> > with: >> > >> > before_save :whatever >> > >> > private >> > >> > def whatever >> > # whatever >> > end >> > >> > HTH, >> > Jeffrey >> > >> > -- >> > 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+unsubscr...@googlegroups.com. >> > For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > >> >> -- >> 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+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> >> > -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: Re: [Rails] Upgrading to Rails 3
Hi Jodi, Thanks for this great point about testing and plugins that need to be upgraded. Its really helpful Kind Regards Gurdipe On 7 April 2012 15:30, Jodi Showers wrote: > I suggest you get your tests in gear if not already > > get a core group (start with models, then controllers, minimum of models) > passing in 2.3.5 > > then upgrade > > you'll find a great number of plugins and gems will need to be upgraded - > and some will have to be hand patched if you cannot find a suitable > replacement > Jodi > > On 2012-04-07, at 9:08 AM, Jeffrey L. Taylor wrote: > > > Quoting Gurdipe Dosanjh : > >> Hi All, > >> > >> Re: Upgrading to Rails 3 > >> > >> I am working on a rails application I need to upgrade to the latest > version > >> of Ruby and Ruby on Rails. > >> > >> It is currently using: > >> > >> Ruby version 1.8.7 and > >> Ruby on Rails version 2.3.5 > >> > >> Is there any information, tutorial, guides etc. I can follow > >> > >> Any help would be greatly appreciated > >> > > > > In addition to the other advice, overriding ActiveRecord callbacks was > > deprecated in 2.3.8. So replace > > > > def before_save > > # whatever > > end > > > > with: > > > > before_save :whatever > > > > private > > > > def whatever > > # whatever > > end > > > > HTH, > > Jeffrey > > > > -- > > 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+unsubscr...@googlegroups.com. > > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > -- > 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+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Can't get debugger to work on MacOS X Lion/Rails 3.2/Ruby 1.9.3
On Apr 8, 2012, at 2:43 , David Paschich wrote: > I'm trying to get the ruby debugger working and can't seem to get there. > Environment summary: > > Mac OS X Lion > RVM > Ruby 1.9.3p125 > Rails 3.2.3 > Rspec 2.9.0 > > I've put the debugger statement in my controller like so: > > def show > debugger > seasons = Season.where(:name=>params[:id]) > puts @seasons > @season = seasons.first > puts @season > @season_entries = @season.season_entries > end > > And run my spec like so: > > $ bundle exec rspec -d spec/controllers/seasons_controller_spec.rb try $ RUBYOPT='-r openssl' bundle exec rspec -d spec/controllers/seasons_controller_spec.rb it looks weird but usually works :) -- === Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz === -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: Upgrading to Rails 3
Hi Colin, Thanks this point, I am also carrying out a exercise to ensure all the testing is checked and up to date. Kind Regards Gurdipe On 7 April 2012 09:25, Colin Law wrote: > On 6 April 2012 20:35, Gurdipe Dosanjh wrote: > > Hi All, > > > > Re: Upgrading to Rails 3 > > > > I am working on a rails application I need to upgrade to the latest > version > > of Ruby and Ruby on Rails. > > Make sure your automated test coverage is complete before you start, > then you can be reasonably confident, when you have finished, that all > is working. > > Colin > > > > > It is currently using: > > > > Ruby version 1.8.7 and > > Ruby on Rails version 2.3.5 > > > > Is there any information, tutorial, guides etc. I can follow > > > > Any help would be greatly appreciated > > > > Kind Regards > > > > Gurdipe > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Talk" group. > > To view this discussion on the web visit > > https://groups.google.com/d/msg/rubyonrails-talk/-/-GwOpn34jqsJ. > > To post to this group, send email to rubyonrails-talk@googlegroups.com. > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscr...@googlegroups.com. > > For more options, visit this group at > > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > -- > gplus.to/clanlaw > > -- > 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+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.