Re: [Rails] Re: Re: test Couldn't find User without an ID

2012-03-27 Thread Ahmy Yulrizka
so basically its not params[:user_id] it's params[:comment][:user_id] Ahmy Yulrizka On Tue, Mar 27, 2012 at 11:17 PM, Neil Bye wrote: > Cpx Cpx wrote in post #1053588: > > This line: > > post :create, :comment => @comment.attributes > > > > The second parameter (hash) is the content of params i

Re: [Rails] Re: Scaling Upload in Rails Application?

2012-03-27 Thread Ahmy Yulrizka
I got this from the heroku documentation Pass-through uploads Pass-through uploading sends the file from the user to the application on Heroku which then uploads it to S3. Benefits of this approach include the ability to pre-process user-uploads before storing in S3. However, be careful that lar

Re: [Rails] [ANN] Rails 3.2.3.rc1 was released!

2012-03-27 Thread Bill Walton
Hi Santiago, On Tue, Mar 27, 2012 at 12:16 PM, Santiago Pastorino wrote: > Rails 3.2.3.rc1 has been released. > *ActionPack* > > *   Do not include the authenticity token in forms where remote: true > as ajax forms use the meta-tag value *DHH* Could you please point me to more on this? Thanks,

[Rails] Re: uninitialized constant Reservations

2012-03-27 Thread ruby LED
Colin Law wrote in post #1053624: > On 27 March 2012 10:50, ruby LED wrote: >> def functionroom >> <%end%> >> - >> class ReservationFunctionRoomsController < InheritedResources::Base >> >> end >> >> >> has_many :reservation_function_rooms >> else >

[Rails] How to change error message of authlogic only n certain cases

2012-03-27 Thread tamagohan
Hi all, I update password of user and validate input data with "authlogic" User must input current password, new password and new password confirmation when user updates user's password. So, I want to display follow error message if user fails to update. "new password is invalid." I think to edit

Re: [Rails] How to add data-some thing with link_to method

2012-03-27 Thread Javier Quarite
On Tue, Mar 27, 2012 at 9:16 PM, Karthikeyan A k wrote: > The question is how to create this: > > Launch Modal > > Using link_to method > > <%= link_to "Launch Modal","#myModal", :data => {:toggle=>"modal"}, :class=>"btn"%> -- You received this message because you are subscribed to the Google Gr

[Rails] How to add data-some thing with link_to method

2012-03-27 Thread Karthikeyan A k
The question is how to create this: Launch Modal Using link_to method -- 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

Re: [Rails] Re: Dynamic Select Menus for Rails 3

2012-03-27 Thread Walter Lee Davis
On Mar 27, 2012, at 8:46 PM, Cluter Vipic wrote: > Thanks for the answers, > > follow the source web page, I have: > > Basket > Please > select > Awesome > Normal > > Apple > Please > select > Green > Red > Yellow > White > > > > To works I have to pass the right variable in the follow line

Re: [Rails] Help with force_ssl

2012-03-27 Thread subbarao
On 03/27/2012 06:05 PM, eduardo altrez wrote: Hi, I'd like to force_ssl on all the requests on my application, but not when the subdomain user is foo. How can I do this? The best way would be something like (in the application controller): force_ssl :unless => proc {|request| request.subdomain

[Rails] Re: Dynamic Select Menus for Rails 3

2012-03-27 Thread Cluter Vipic
Thanks for the answers, follow the source web page, I have: Basket Please select Awesome Normal Apple Please select Green Red Yellow White To works I have to pass the right variable in the follow line options = $(apple).filter("[label=#{basket}]").html() I think the problem is here: label=#

[Rails] Re: strange javascript rendering

2012-03-27 Thread John Merlino
This was a simple fix. You dont escape html in rails 3. On Mar 26, 5:38 pm, John Merlino wrote: > I have a form helper that looks like this: > > #_alert.html.haml > = add_field_link "Add Email", f, :notification_emails > > #application_helper.rb >   def add_field_link(name, f, association) >    

Re: [Rails] Device Convention for Scope ?

2012-03-27 Thread Colin Law
On 27 March 2012 11:43, Ahmy Yulrizka wrote: > I've been using device for quite some times now. I was wondering a good > practice to design the application with scope. Usually I choose to separate > the admin part and the user part. so there is two model Admin and User. I would not do it that way

Re: [Rails] Re: Upload

2012-03-27 Thread Frederick Cheung
On 27 Mar 2012, at 14:59, Aaron Schmitz wrote: > i've got a multipart-form with > > <%= file_field_tag 'objects[]', :id => 'file', :multiple => true %> > > rails does the upload when i click on "go". in firebug i can see that > there is a post 200 going on and i can see how long the upload

Re: [Rails] Re: Scaling Upload in Rails Application?

2012-03-27 Thread Martin Wawrusch
One solution is to use transloadit.com and bypass the server entirely. On Tue, Mar 27, 2012 at 11:25 AM, Frederick Cheung < frederick.che...@gmail.com> wrote: > > > On Mar 27, 11:56 am, Ahmy Yulrizka wrote: > > I always got scared when my client ask for upload functionality. > Basically > > from

[Rails] Re: Scaling Upload in Rails Application?

2012-03-27 Thread Frederick Cheung
On Mar 27, 11:56 am, Ahmy Yulrizka wrote: > I always got scared when my client ask for upload functionality. Basically > from what I've read that when user uploaded a file it will an instance of > the web server. So if i have one dyno (instance) on heroku, while one user > is uploading a big fil

[Rails] Re: rescuing ActiveRecord::RecordNotUnique: clever or ugly?

2012-03-27 Thread Joe V.
Fearless Fool wrote in post #1053062: > Peter Vandenabeele wrote in post #1052874: >> A custom validation on the compound unique key would behave >> similar, always do a SELECT (and suffer from the race condition >> documented in >> > http://api.rubyonrails.org/classes/ActiveRecord/Validations/Clas

[Rails] Re: [ANN] Rails 3.2.3.rc1 was released!

2012-03-27 Thread Santiago Pastorino
Just a minor fix, I will release the final version on March 30th On Tue, Mar 27, 2012 at 2:17 PM, Santiago Pastorino wrote: > Rails 3.2.3.rc1 has been released. > > ### IMPORTANT > > This release changes the default value of > *config.active_record.whitelist_attributes* to true.  This change only

[Rails] [ANN] Rails 3.2.3.rc1 was released!

2012-03-27 Thread Santiago Pastorino
Rails 3.2.3.rc1 has been released. ### IMPORTANT This release changes the default value of *config.active_record.whitelist_attributes* to true. This change only affects newly generated applications so it should not cause any backwards compatibility issues for users who are upgrading but it may a

Re: [Rails] Re: Dynamic Select Menus for Rails 3

2012-03-27 Thread Walter Lee Davis
On Mar 27, 2012, at 12:42 PM, bluetwin wrote: > What exactly aren't you having luck with? Do you need help with the > JQuery conversion? It sounds like he's using html() to replace the innards of a select list, and that doesn't usually work. Walter > As Walter Lee said, Rails 3 defaults with

[Rails] Re: Dynamic Select Menus for Rails 3

2012-03-27 Thread bluetwin
What exactly aren't you having luck with? Do you need help with the JQuery conversion? As Walter Lee said, Rails 3 defaults with JQuery now. On Feb 6, 1:41 am, sly verano wrote: > Guys help me please. How to convert this rails-cast to rails 3 ? I'm > trying to convert it but still there is no luc

Re: [Rails] uninitialized constant Reservations

2012-03-27 Thread Colin Law
On 27 March 2012 10:50, ruby LED wrote: > hi im having a bit trouble in my application im new in ROR development > i made a static page where my function rooms of my reservation > application are showed and can be add in in the > reservation_function_room(line item of reservation functionroom) it

Re: [Rails] Database and model design for multiple user roles

2012-03-27 Thread Colin Law
On 25 March 2012 09:52, pavlos kallis wrote: > I would like to create a web application that has two types of users, > producer and consumer. > Both users have three fields in common : username,password and email. > Producer has also the fields address and telephone. > I could make separate models

[Rails] Re: Re: test Couldn't find User without an ID

2012-03-27 Thread Neil Bye
Cpx Cpx wrote in post #1053588: > This line: > post :create, :comment => @comment.attributes > > The second parameter (hash) is the content of params in your controller. > So > basically your params[:comment] would be @comment.attributes > > So if you expected params[:user_id] then you should pass

Re: [Rails] render :js => "window.close();" wont work

2012-03-27 Thread yan shi
muchas gracias 在 2012年3月27日 下午11:10,Walter Lee Davis 写道: > > On Mar 27, 2012, at 11:05 AM, yan shi wrote: > > > thx very much. so is there any ways to accomplish that? > > If you're asking if the page can close the main (or any user-opened) > window, the answer is no, and for good reason. The pag

Re: [Rails] Re: test Couldn't find User without an ID

2012-03-27 Thread Ahmy Yulrizka
This line: post :create, :comment => @comment.attributes The second parameter (hash) is the content of params in your controller. So basically your params[:comment] would be @comment.attributes So if you expected params[:user_id] then you should pass it to the post call Ahmy Yulrizka On Tue, M

Re: [Rails] render :js => "window.close();" wont work

2012-03-27 Thread Walter Lee Davis
On Mar 27, 2012, at 11:05 AM, yan shi wrote: > thx very much. so is there any ways to accomplish that? If you're asking if the page can close the main (or any user-opened) window, the answer is no, and for good reason. The page can close itself if the window was opened programmatically, but it

Re: [Rails] render :js => "window.close();" wont work

2012-03-27 Thread yan shi
thx very much. so is there any ways to accomplish that? 在 2012年3月27日 下午11:02,Walter Lee Davis 写道: > > On Mar 27, 2012, at 10:17 AM, yan shi wrote: > > > when i try to do the following in a action > > render :js => "window.close();" wont work > > > > it still response in the browser,but the window

Re: [Rails] render :js => "window.close();" wont work

2012-03-27 Thread Walter Lee Davis
On Mar 27, 2012, at 10:17 AM, yan shi wrote: > when i try to do the following in a action > render :js => "window.close();" wont work > > it still response in the browser,but the window wont close. > i dont know why.thx! You can only close a window in JavaScript if you also opened it in JavaScr

Re: [Rails] how can i custom form_for ?

2012-03-27 Thread yan shi
hey man, do it in the action. 2012/3/26 li bo > > have > someone same as me ? > can i custom form_for like : > > -- > You received this message because you a

[Rails] render :js => "window.close();" wont work

2012-03-27 Thread yan shi
when i try to do the following in a action render :js => "window.close();" wont work it still response in the browser,but the window wont close. i dont know why.thx! -- *愿爱与喜悦心与你同在! 石岩敬上 大连东软信息学院 计算机系软件工程应用方向 Dalian NEUSOFT Institute of Information 中国-大连市软件园路8号 邮编:116023 **Mail:hlcfan@gmail.

Re: [Rails] Re: jQuery unload() wont work.Help.

2012-03-27 Thread yan shi
ok.its done.ya.matters of browser.i use chrome 17. 2012/3/27 Aaron Schmitz > which browser do you use? > > -- > 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

Re: [Rails] Re: Upload

2012-03-27 Thread yan shi
oh.sorry.u'd better get to know subprocess.certainly,subprocess is a way in python. 2012/3/27 Aaron Schmitz > i've got a multipart-form with > > <%= file_field_tag 'objects[]', :id => 'file', :multiple => true %> > > rails does the upload when i click on "go". in firebug i can see that > there

[Rails] Re: [Bangalore RUG] Rails Internationalization problem while submitting the form.

2012-03-27 Thread deepak kannan
Take a look at http://guides.rubyonrails.org/i18n.html#setting-the-locale-from-the-client-supplied-information On changing the language, store in session-store and set the locale from the session store thereafter Also store the locale in the users table. use this in case the session is refreshed

[Rails] Re: Upload

2012-03-27 Thread Aaron Schmitz
i've got a multipart-form with <%= file_field_tag 'objects[]', :id => 'file', :multiple => true %> rails does the upload when i click on "go". in firebug i can see that there is a post 200 going on and i can see how long the upload takes. how can i access this whithout ajax? -- You received

[Rails] Re: test Couldn't find User without an ID

2012-03-27 Thread Neil Bye
Cpx Cpx wrote in post #1053539: > Check the params[:user_id] i think it was nil > > Ahmy Yulrizka So it is. How can I introduce a user in the fixtures or setup to give it a value? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google

[Rails] Help with force_ssl

2012-03-27 Thread eduardo altrez
Hi, I'd like to force_ssl on all the requests on my application, but not when the subdomain user is foo. How can I do this? The best way would be something like (in the application controller): force_ssl :unless => proc {|request| request.subdomain == 'foo'} But from what I read from the doc ( ht

[Rails] Re: command 'subl Gemfile' does not work

2012-03-27 Thread seanlynch
After installing sublime_text you will have an executable sublime_text. As root, copy this to somewhere in your executable path (ie /opt). You can also install it some where and add that somewhere to your executable path. You should now be able to execute from the command line with: $ sublime_text

Re: [Rails] test Couldn't find User without an ID

2012-03-27 Thread Ahmy Yulrizka
Check the params[:user_id] i think it was nil Ahmy Yulrizka On Tue, Mar 27, 2012 at 7:19 PM, Neil Bye wrote: >@user = User.find(params[:user_id]) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email t

Re: [Rails] what's wrong with this?

2012-03-27 Thread Fernando Almeida
'tags/form' is a relative path, you should '/tags/form' to absolute path. 2012/3/26 E Y > <%= render :partial => 'tags/form', > :locals => {:form => post_form} %> > > Missing partial tags/form with > {:handlers=>[:erb, :coffee, :builder], :formats=>[:html], :locale=>[:en]}. > >

[Rails] test Couldn't find User without an ID

2012-03-27 Thread Neil Bye
I am trying to run this test setup do @comment = comments(:hello) @comment.commenter = "cleb" @comment.body = "hello" @comment.user_id = 1 end test "should create comment" do assert_difference('Comment.count') do post :create, :comment => @comment.attributes end

[Rails] Running just one test in Test::Unit

2012-03-27 Thread David M
Is there any other way to run just one test in Test::Unit different than the -n option? With the addition of Minitest in Ruby 1.9, is there some new way to do that? It would be fantastic to have something like RSpec's tag filtering. -- You received this message because you are subscribed to th

[Rails] Re: jQuery unload() wont work.Help.

2012-03-27 Thread Aaron Schmitz
which browser do you use? -- 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

[Rails] Re: jQuery unload() wont work.Help.

2012-03-27 Thread Aaron Schmitz
the first one is working for me -- 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...@googlegrou

[Rails] Re: what's wrong with this?

2012-03-27 Thread Aaron Schmitz
is there a partial in this format: "_form.html.erb"? or do you want to access post_form in the folder "tags"? -- 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

Re: [Rails] Upload

2012-03-27 Thread yan shi
before u r uploading file,u could get the size of file.so compare the size. 2012/3/27 Aaron Schmitz > hello everyone, > > i have written an upload controller which handles files in a multipart- > form. it scans through the bytes to check if it's an acceptable file. > my problem is to get the pro

[Rails] Upload

2012-03-27 Thread Aaron Schmitz
hello everyone, i have written an upload controller which handles files in a multipart- form. it scans through the bytes to check if it's an acceptable file. my problem is to get the progress of the upload of a single file. i loop through my params to move every file to the server and it's working

[Rails] Scaling Upload in Rails Application?

2012-03-27 Thread Ahmy Yulrizka
I always got scared when my client ask for upload functionality. Basically from what I've read that when user uploaded a file it will an instance of the web server. So if i have one dyno (instance) on heroku, while one user is uploading a big file then the application would not respond to another u

[Rails] Device Convention for Scope ?

2012-03-27 Thread Ahmy Yulrizka
I've been using device for quite some times now. I was wondering a good practice to design the application with scope. Usually I choose to separate the admin part and the user part. so there is two model Admin and User. Admin functionality are scoped with Admin , And user functionality are just li

Re: [Rails] `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes

2012-03-27 Thread Pravin Mishra
include this gem too in gem file and run bunlde install gem 'execjs' http://stackoverflow.com/questions/6282307/execjs-and-could-not-find-a-javascript-runtime On 27/03/2012, Chitrank Samaiya wrote: > add gem therubyracer in your gemfile,then check it. > for ubantu users it gives problem while f

[Rails] Re: gem install nokogiri on Windows XP

2012-03-27 Thread ruby LED
do you have dev-tool installed? just checking. -- 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 gr

Re: [Rails] `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes

2012-03-27 Thread Chitrank Samaiya
add gem therubyracer in your gemfile,then check it. for ubantu users it gives problem while fir window there is no such problem. regards chitrank -- 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 rubyo

[Rails] Offline apps and Asset pipeline Problem in rails3.2

2012-03-27 Thread sanemat
I have a question about using rack-offline with asset pipeline in rails3.2.2. rack-offline creates application.manifest for local caching. This gem watches file modification then re-generate hash-key in manifest. I confuse offline apps with asset pipeline. asset pipeline provides variable paths

[Rails] what's wrong with this?

2012-03-27 Thread E Y
<%= render :partial => 'tags/form', :locals => {:form => post_form} %> Missing partial tags/form with {:handlers=>[:erb, :coffee, :builder], :formats=>[:html], :locale=>[:en]}. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" g

[Rails] how can i custom form_for ?

2012-03-27 Thread li bo
have someone same as me ? can i custom form_for like : -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"

Re: [Rails] `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes

2012-03-27 Thread Rai M
no the problem is still same... On Tue, Mar 27, 2012 at 2:28 PM, Colin Law wrote: > On 27 March 2012 07:13, Rai M wrote: > > re installed gem > > execjs (1.3.0)o t > > So has that fixed it? Not much point telling us you have re-installed > unless you tell us what the outcome was. > > Colin

[Rails] why ???zsh: command not found: rails

2012-03-27 Thread rubyisgood
$gem install rails -n /home/steven/.rvm/gems/ruby-1.9.2-p318/bin -l Successfully installed rails-3.2.2 1 gem installed Installing ri documentation for rails-3.2.2... Installing RDoc documentation for rails-3.2.2... $rvm use 1.9.2 $ rails -v zsh: command not found: rails

[Rails] command 'subl Gemfile' does not work

2012-03-27 Thread Sumer Joshi
Hey, I tried 'subl Gemfile' as they said for the command, but 'subl' is not recognized as a command. How do I "recognize" sublime from cmd? Thanks, Sumer -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email

Re: [Rails] gem install nokogiri on Windows XP

2012-03-27 Thread Nicklas af Ekenstam
On Mon, Mar 26, 2012 at 2:37 PM, Kee Kee Mu wrote: > I issue the command "gem install nokogiri" on Windows XP console. I use > Cygwin. > And, I got the following errors, please help. > > $ gem install nokogiri > Building native extensions.  This could take a while... > ERROR:  Error installing nok

[Rails] Database and model design for multiple user roles

2012-03-27 Thread pavlos kallis
I would like to create a web application that has two types of users, producer and consumer. Both users have three fields in common : username,password and email. Producer has also the fields address and telephone. I could make separate models,views,controller and tables for each user types but

[Rails] JRuby in Google Summer of Code...proposals open TODAY!

2012-03-27 Thread Charles Oliver Nutter
JRuby has been accepted to the Google Summer of Code 2012! Student proposals can be submitted starting *TODAY*, and we really want to make a good showing for both JRuby and Ruby. Tell your friends, tell your neighbors, pass this on to anyone you think would be a good student or mentor! This co

[Rails] uninitialized constant Reservations

2012-03-27 Thread ruby LED
hi im having a bit trouble in my application im new in ROR development i made a static page where my function rooms of my reservation application are showed and can be add in in the reservation_function_room(line item of reservation functionroom) it raises uninitialized constant Reservations cant f

Re: [Rails] `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes

2012-03-27 Thread Pravin Mishra
I faced same issues. add these gem in assets group gem 'uglifier' gem 'therubyracer' then run bundle install. It works for me. On 27 March 2012 14:28, Colin Law wrote: > On 27 March 2012 07:13, Rai M wrote: > > re installed gem > > execjs (1.3.0) > > So has that fixed it? Not much point t

Re: [Rails] `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes

2012-03-27 Thread Colin Law
On 27 March 2012 07:13, Rai M wrote: > re installed gem > execjs (1.3.0) So has that fixed it? Not much point telling us you have re-installed unless you tell us what the outcome was. Colin > On Tue, Mar 27, 2012 at 11:34 AM, Rai M wrote: >> >> >> >> I have installed >> >> ruby 1.9.2p318 (201

Re: [Rails] rails test failure

2012-03-27 Thread Colin Law
On 27 March 2012 00:35, gerbdla wrote: > Not sure if this is for this group or not but I am running some rake > tests and getting this failure > Test run options: --seed 45998 > rake aborted! > Errors in activerecord Post the full error seen and the code or command that triggers it. Colin -- Y

[Rails] Can I conditionaly initializer ?

2012-03-27 Thread femto Zheng
Hello, I'm trying to add to spree functionlity gateway of china, I check out the documentation and follow the spree_gateway, in engine.rb initializer "spree.gateway.payment_methods", :after => "spree.register.payment_methods" do |app| app.config.spree.payment_methods << Spree::Gateway::Aut