[Rails] Re: Morons in our midst (re: important news)

2014-05-28 Thread Frederick Cheung


On Wednesday, May 28, 2014 4:17:26 AM UTC+1, Ken D'Ambrosio wrote:

 Hi, all.  I'm not a frequent contributor -- I'm just ramping up on 
 Rails.  But I've been on the 'Net for quite some time.  And back in the 
 days of yore, on Usenet, we had moderated lists.  In much the same vein, 
 I suggest we stop allowing anonymous submissions to the online forum 
 (which I *believe* is currently the default).  It may go marginally 
 against the spirit of openness, but it *would* stop (or at least vastly 
 reduce) the ability of idiots like the one currently spamming the list 
 from doing just that. 

 Discussion? 


The first post to the this list by a user has to be approved. However all 
posts that come from ruby-forum look to google groups like they are coming 
from the same user, which was approved many years ago. Ruby-forum used to 
allow anonymous posting, although it would seem they require you to create 
an account these days. I'm not sure what can be done from the google groups 
side of things. It does amaze me how terrible the google groups spam filter 
is though (messages that appear to be spam are also queued for 
moderation,but this happens extremely infrequently)

Fred

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/31e80a95-b4a9-4c70-91e5-263538624e2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Rails 4: routing error when mounting an engine in a Rails app as explained in Rails guides

2014-05-28 Thread durga prasad
Can you please explain , how to add typo ?

On Sunday, 29 September 2013 02:07:51 UTC+5:30, Javix wrote:

 It is fixed, I just had a typo in engine route. :).

 On Saturday, September 28, 2013 10:14:26 PM UTC+2, Javix wrote:

 I followed steps on Rails guides on 
 engineshttp://guides.rubyonrails.org/engines.html and 
 it faileds when mounting the engine in unicorn Rails application:

 unicorn  rails s
 = Booting WEBrick
 = Rails 4.0.0 application starting in development on http://0.0.0.0:3000
 = Run `rails server -h` for more startup options
 = Ctrl-C to shutdown server
 Exiting
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:10:in
  
 `rescue in execute_if_updated': 
 Rails::Application::RoutesReloader#execute_if_updated delegated to 
 updater.execute_if_updated, but updater is nil: 
 #Rails::Application::RoutesReloader:0x007fc39aff04f0 
 @paths=[/Users/scambour/workspace/unicorn/config/routes.rb, 
 /Users/scambour/workspace/blorgh/config/routes.rb], 
 @route_sets=[#ActionDispatch::Routing::RouteSet:0x007fc39ac008b8, 
 #ActionDispatch::Routing::RouteSet:0x007fc39c092c18] (RuntimeError)
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:6:in
  
 `execute_if_updated'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/finisher.rb:69:in
  
 `block in module:Finisher'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:30:in
  
 `instance_exec'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:30:in
  
 `run'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:55:in
  
 `block in run_initializers'
 from 
 /Users/scambour/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:150:in 
 `block in tsort_each'
 from 
 /Users/scambour/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:183:in 
 `block (2 levels) in each_strongly_connected_component'
 from 
 /Users/scambour/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:219:in 
 `each_strongly_connected_component_from'
 from 
 /Users/scambour/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:182:in 
 `block in each_strongly_connected_component'
 from 
 /Users/scambour/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in 
 `each'
 from 
 /Users/scambour/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in 
 `each_strongly_connected_component'
 from 
 /Users/scambour/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:148:in 
 `tsort_each'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:54:in
  
 `run_initializers'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application.rb:215:in
  
 `initialize!'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in
  
 `method_missing'
 from /Users/scambour/workspace/unicorn/config/environment.rb:5:in `top 
 (required)'
 from /Users/scambour/workspace/unicorn/config.ru:3:in `require'
 from /Users/scambour/workspace/unicorn/config.ru:3:in `block in main'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:55:in
  
 `instance_eval'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:55:in
  
 `initialize'
 from /Users/scambour/workspace/unicorn/config.ru:in `new'
 from /Users/scambour/workspace/unicorn/config.ru:in `main'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:49:in
  
 `eval'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:49:in
  
 `new_from_string'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:40:in
  
 `parse_file'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/server.rb:277:in
  
 `build_app_and_options_from_config'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/server.rb:199:in
  
 `app'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands/server.rb:48:in
  
 `app'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/server.rb:314:in
  
 `wrapped_app'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands/server.rb:75:in
  
 `start'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:78:in
  
 `block in top (required)'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:73:in
  
 `tap'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:73:in
  
 `top (required)'
 from bin/rails:4:in `require'
 from bin/rails:4:in `main'

 Just after adding the path to the blorgh engin into the Gemfile:

 source 'https://rubygems.org'

 # Bundle edge 

[Rails] Re: Beginner's routing question: Redirecting to a different controller

2014-05-28 Thread Ronald Fischer
Thank you for the suggestions. I went through the tutorial found on the 
web (which was explaining the concepts using the example of making a 
blog site), but could relate what I have learned, only to the concept of 
the idioms in my project, but not to the rest of my application.

I now see that is a good idea to treat the user as its own resource, 
because sooner or later I will need this anyway, and I will try to 
redesign my application.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/24c5eb2b7daf193ca5c12a955d444071%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Re: Rails 4: routing error when mounting an engine in a Rails app as explained in Rails guides

2014-05-28 Thread Serguei Cambour
I did NOT mean typo as Typo
Softwarehttp://en.wikipedia.org/wiki/Typo_(software) but
the one as Typographical errorhttp://en.wikipedia.org/wiki/Typographical_error
 :)


On 27 May 2014 12:21, durga prasad prasadmca...@gmail.com wrote:

 Can you please explain , how to add typo ?

 On Sunday, 29 September 2013 02:07:51 UTC+5:30, Javix wrote:

 It is fixed, I just had a typo in engine route. :).

 On Saturday, September 28, 2013 10:14:26 PM UTC+2, Javix wrote:

 I followed steps on Rails guides on 
 engineshttp://guides.rubyonrails.org/engines.html and
 it faileds when mounting the engine in unicorn Rails application:

 unicorn  rails s
 = Booting WEBrick
 = Rails 4.0.0 application starting in development on
 http://0.0.0.0:3000
 = Run `rails server -h` for more startup options
 = Ctrl-C to shutdown server
 Exiting
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-
 4.0.0/lib/rails/application/routes_reloader.rb:10:in `rescue in
 execute_if_updated': Rails::Application::RoutesReloader#execute_if_updated
 delegated to updater.execute_if_updated, but updater is nil:
 #Rails::Application::RoutesReloader:0x007fc39aff04f0
 @paths=[/Users/scambour/workspace/unicorn/config/routes.rb,
 /Users/scambour/workspace/blorgh/config/routes.rb],
 @route_sets=[#ActionDispatch::Routing::RouteSet:0x007fc39ac008b8,
 #ActionDispatch::Routing::RouteSet:0x007fc39c092c18] (RuntimeError)
 from /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-
 4.0.0/lib/rails/application/routes_reloader.rb:6:in `execute_if_updated'
 from /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-
 4.0.0/lib/rails/application/finisher.rb:69:in `block in
 module:Finisher'
 from /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-
 4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
 from /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-
 4.0.0/lib/rails/initializable.rb:30:in `run'
 from /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-
 4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
 from 
 /Users/scambour/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:150:in
 `block in tsort_each'
 from 
 /Users/scambour/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:183:in
 `block (2 levels) in each_strongly_connected_component'
 from 
 /Users/scambour/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:219:in
 `each_strongly_connected_component_from'
 from 
 /Users/scambour/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:182:in
 `block in each_strongly_connected_component'
 from 
 /Users/scambour/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in
 `each'
 from 
 /Users/scambour/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in
 `each_strongly_connected_component'
 from 
 /Users/scambour/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:148:in
 `tsort_each'
 from /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-
 4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
 from /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-
 4.0.0/lib/rails/application.rb:215:in `initialize!'
 from /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-
 4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
 from /Users/scambour/workspace/unicorn/config/environment.rb:5:in `top
 (required)'
 from /Users/scambour/workspace/unicorn/config.ru:3:in `require'
 from /Users/scambour/workspace/unicorn/config.ru:3:in `block in main'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:55:in
 `instance_eval'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:55:in
 `initialize'
 from /Users/scambour/workspace/unicorn/config.ru:in `new'
 from /Users/scambour/workspace/unicorn/config.ru:in `main'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:49:in
 `eval'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:49:in
 `new_from_string'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/builder.rb:40:in
 `parse_file'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/server.rb:277:in
 `build_app_and_options_from_config'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/server.rb:199:in
 `app'
 from /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-
 4.0.0/lib/rails/commands/server.rb:48:in `app'
 from 
 /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/server.rb:314:in
 `wrapped_app'
 from /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-
 4.0.0/lib/rails/commands/server.rb:75:in `start'
 from /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-
 4.0.0/lib/rails/commands.rb:78:in `block in top (required)'
 from /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-
 4.0.0/lib/rails/commands.rb:73:in `tap'
 from /Users/scambour/.rvm/gems/ruby-2.0.0-p247/gems/railties-
 4.0.0/lib/rails/commands.rb:73:in `top (required)'
 from bin/rails:4:in 

[Rails] Re: [JOBS] [Remote] Excellent Rails (full stack) developer required

2014-05-28 Thread Sunil Kumar
Hi,
  I am sunil kumar.I have 3 years ruby on rails development experience.I am 
looking part time ruby on rails job.

Thanks
Sunil 

On Wednesday, May 21, 2014 12:14:16 AM UTC+5:30, Ruby-Forum.com User wrote:

 I run a small consulting company based in London, UK. I am looking to 
 employ an excellent developer full-time to help develop existing and 
 upcoming projects. We work remotely so you can work from anywhere - 
 there is no need to be based in the UK. 


 We like to develop apps using the prime stack, with skinny models and 
 controllers with business logic in the service layer. For testing we use 
 Capybara and RSpec. For storage PostgreSQL and Redis. On the frontend 
 SASS or LESS and CoffeeScript with spine.js and Backbone. 


 Things I am looking for: 


 * really care about clean architecture 
 * 5+ years experience professionally 
 * 2+ years experience with Rails 
 * good work ethic 
 * can estimate work accurately and develop quickly 
 * available full-time (or part-time now and full-time later) 
 * fluent English 


 If you're available now or soon, please email me at 
 lu...@sketchconsulting.com javascript: and I will get back to you with 
 more details. 
 If you send a sample Rails app you have created, you will have a better 
 chance. 

 Salary is quite flexible - it depends on how good you are. But 
 approximately £30-£40k per year (around US$60k). I appreciate this is 
 not great if you are from the UK or US, so it likely suits someone from 
 a less tech-focused place. 

 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 unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/42339867-9e26-4a19-a20d-cc5e432e03fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: [JOBS] Junior RoR developer (remotely)

2014-05-28 Thread Sunil Kumar
Hi,
  I am very interested with this job.Please contact me 7696099799


Thanks
sunil 

On Sunday, May 18, 2014 12:42:34 AM UTC+5:30, Ruby-Forum.com User wrote:

 Hi guys, 

 The company I'm contracting at is looking for: 

 Junior Ruby on Rails developer 

 Requirements: 

 * experience with building Rails/Sinatra web applications, 

 * Experience with Javascript/jQuery (good to have: Angular, /Backbone) 

 * Experience with building  frontend part of application 

 * Good understanding of English (spoken and written) 


 Looking Forward, 

 chita...@yahoo.com 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 unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/56142ef7-eb9e-4ec1-a097-94930d091990%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] SPECIALS RELATIONSHIP!?

2014-05-28 Thread Simon Eric
i want to associate one model with 4 models. For example i call a first
model Spectacle and call others Hall1, Hall2, Hall3 and Hall4.  All of
Halls have the same attributes: id and seat.  Each Hall have 10 seats.
I  want to create an spectacle on the database and associate it with any
Hall.
Problems:
How can i do this association in rails?
It is possible to do this type of association?
How can i get all of Hall's seats  through spectacle that i created?

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/cd4387b9642d9a6892bbcf6bccb3a361%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Re: HTTPI::SSLError - Plz help

2014-05-28 Thread Usha Murali
Hi plz see below for the ssl doctor script output:

export SSL_CERT_FILE=/usr/lib/ssl/cert.pem   export
SSL_CERT_DIR=/usr/lib/ssl

*ruby doctor.rb localhost*
*/usr/local/bin/ruby (1.8.7-p330)*
*OpenSSL 0.9.8k 25 Mar 2009: /usr/lib/ssl*
*SSL_CERT_DIR=/usr/lib/ssl*
*SSL_CERT_FILE=/usr/lib/ssl/cert.pem*

*HEAD https://localhost:443 https://localhost:443*
*Error: connection refused*




On Wed, May 28, 2014 at 12:36 AM, Matt Jones al2o...@gmail.com wrote:



 On Tuesday, 27 May 2014 00:51:47 UTC-5, Usha wrote:

 Dear All,

 rvm ssl updated sucessfully and Openssl/ca cert seems to be correct in my
 system but still i get  HTTPI::SSL Error, Plz help me , my environment as
 follows:

 $ whereis openssl
 openssl: /usr/bin/openssl /usr/include/openssl
 /usr/share/man/man1/openssl.
 1ssl.gz

 $ env | grep -i ssl
 SSL_CERT_FILE=/usr/lib/ssl/cert.pem

 $ rvm osx-ssl-certs status all
 Certificates for /usr/lib/ssl/cert.pem: Up to date.

 rvm osx-ssl-certs status all
 Certificates for /usr/lib/ssl/cert.pem: Up to date.

 $ rvm reload
 RVM reloaded


 Still it throws the following error, plz suggest how to resolve this, I
 have spent nearly one day still cant figure out the issue, plz help me ,
 the error as follws:

 HTTPI::SSLError in searchesController

 SSL_connect returned=1 errno=0 state=SSLv3 read server hello A: sslv3 alert 
 handshake failure
 SSL_connect returned=1 errno=0 state=SSLv3 read server hello A: sslv3 alert 
 handshake failureRAILS_ROOT: /usha/myapp

 2.1.0/lib/httpi/adapter/httpclient.rb:28:in `request'
 /ruby-1.8.7-p330/gems/httpi-2.1.0/lib/httpi.rb:140:in `request'
 .rvm/gems/ruby-1.8.7-p330/gems/httpi-2.1.0/lib/httpi.rb:112:in `post'
 /.rvm/gems/ruby-1.8.7-p330/gems/savon-2.3.2/lib/savon/operation.rb:86:in
 `call_with_logging' 
 .rvm/gems/ruby-1.8.7-p330/gems/savon-2.3.2/lib/savon/request_logger.rb:12:in
 `call' 
 rvm/gems/ruby-1.8.7-p330/gems/savon-2.3.2/lib/savon/request_logger.rb:12:in
 `/.rvm/gems/ruby-1.8.7-p330/gems/savon-2.3.2/lib/savon/client.rb:36:in
 `call'

 Any help is appreciated, Plz shed some light in this issue.


 Mislav's ssl doctor script (bottom of the post) can be useful:

 http://mislav.uniqpath.com/2013/07/ruby-openssl/

 If nothing else, posting what it outputs should provide more information
 to troubleshoot this issue.

 --Matt Jones


 --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to rubyonrails-talk+unsubscr...@googlegroups.com.
 To post to this group, send email to rubyonrails-talk@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/rubyonrails-talk/4cea40d1-9c1f-44c9-aa25-11f338fbc74a%40googlegroups.comhttps://groups.google.com/d/msgid/rubyonrails-talk/4cea40d1-9c1f-44c9-aa25-11f338fbc74a%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAKNenNBHMJNjY%2BV6pF9z_RYgSAkqnq5AYgE0YELSuO2TDJA5dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] SPECIALS RELATIONSHIP!?

2014-05-28 Thread Colin Law
On 28 May 2014 14:30, Simon Eric li...@ruby-forum.com wrote:
 i want to associate one model with 4 models. For example i call a first
 model Spectacle and call others Hall1, Hall2, Hall3 and Hall4.  All of
 Halls have the same attributes: id and seat.  Each Hall have 10 seats.
 I  want to create an spectacle on the database and associate it with any
 Hall.
 Problems:
 How can i do this association in rails?

Just have one halls table, with an additional field of, for example,
hall_number.  Then have spectacle belongs_to hall, hall has_many
spectacles (assuming this is what you want).

 It is possible to do this type of association?
 How can i get all of Hall's seats  through spectacle that i created?

To get all the seats for a spectacle, assuming that hall has_many seats use
@spectacle.hall.seats

Colin

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLvu7h5e7OVZYGRsUfsJ7sd8dkN6XG1xDLCH7nmM6NE0oA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] SPECIALS RELATIONSHIP!?

2014-05-28 Thread Jesse Knutsen

does each hall have to be specifically designated as hallx?
and do halls exist independently of spectacle?

Assuming that halls exist independently, it sounds like having a join 
table and position attributes on the join should work

spectacle
has_many :halls

spectacle_hall_join
belongs_to :hall
belongs_to :spectacle

hall
has_many :spectacles, through: spectacle_hall_join

should do the trick

if you really need to have the ability to call hallx you could add a 
scope to the join
scope :position, lambda {|x| where position: x} # assumes code 
calls only, if users can supply a value you will want to prevent XSS on this


you can take this further to get exactly what you need.

Hope this helps.


On 5/28/14, 9:30 AM, Simon Eric wrote:

i want to associate one model with 4 models. For example i call a first
model Spectacle and call others Hall1, Hall2, Hall3 and Hall4.  All of
Halls have the same attributes: id and seat.  Each Hall have 10 seats.
I  want to create an spectacle on the database and associate it with any
Hall.
Problems:
How can i do this association in rails?
It is possible to do this type of association?
How can i get all of Hall's seats  through spectacle that i created?



--
You received this message because you are subscribed to the Google Groups Ruby on 
Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/5385E8C5.20304%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Beginner's routing question: Redirecting to a different controller

2014-05-28 Thread mike2r


On Wednesday, May 28, 2014 2:55:59 AM UTC-4, Ruby-Forum.com User wrote:

 Thank you for the suggestions. I went through the tutorial found on the 
 web (which was explaining the concepts using the example of making a 
 blog site), but could relate what I have learned, only to the concept of 
 the idioms in my project, but not to the rest of my application. 

 I now see that is a good idea to treat the user as its own resource, 
 because sooner or later I will need this anyway, and I will try to 
 redesign my application. 

 -- 
 Posted via http://www.ruby-forum.com/. 


When you get to the point where you are going to use password 
authentication, re-read the user authentication part of the tutorial. 
 Right now, you have login mapped to an index action.  Actually, login uses 
the concept of a session resource and you create a session when you log in. 
 You will want to understand that concept and how a session store is used 
to maintain security.

Good Luck. 

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/1746b67f-022b-43d6-ac70-94fb06681b6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: SPECIALS RELATIONSHIP!?

2014-05-28 Thread Simon Eric
Thank you very much Jesse!

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/169777d524a46c191072e2b42c969c6d%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: SPECIALS RELATIONSHIP!?

2014-05-28 Thread Simon Eric
Thank you very much Colin. I will try that :)

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/d364c83390c583b6b5579294c73339ce%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Recover select value

2014-05-28 Thread Fab Forestier
I have in my view a select td%= select :nomdefaut, @mydefaut,
@ndefaut%/td

I see the different values of @ndefaut but then but then @mydefaut is
supposed to contain the selected value in the list but when I display
@mydefaut in the view my text field is blank.

I see that we can use collection_tag too but they never show how to
recover the selected value.

Somebody can help me?

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/5bc691ceb020fb998be3dea175c58122%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Recover select value

2014-05-28 Thread Jesse Knutsen

have you tried accessing through params[:nomdefaut]

On 5/28/14, 10:55 AM, Fab Forestier wrote:

I have in my view a select td%= select :nomdefaut, @mydefaut,
@ndefaut%/td

I see the different values of @ndefaut but then but then @mydefaut is
supposed to contain the selected value in the list but when I display
@mydefaut in the view my text field is blank.

I see that we can use collection_tag too but they never show how to
recover the selected value.

Somebody can help me?



--
You received this message because you are subscribed to the Google Groups Ruby on 
Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/5385FAC9.40302%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Recover select value

2014-05-28 Thread Frederick Cheung

On Wednesday, May 28, 2014 3:56:21 PM UTC+1, Ruby-Forum.com User wrote:

 I have in my view a select td%= select :nomdefaut, @mydefaut, 
 @ndefaut%/td 

 

 I see the different values of @ndefaut but then but then @mydefaut is 
 supposed to contain the selected value in the list but when I display 
 @mydefaut in the view my text field is blank. 


I'm not sure those parameters do what you think they do - What the above 
does is create a select tag, where the preselected value is given by 
@nomdefaut.send(@mydefaut).

Where is this textfield that is supposed to display this value? Typically 
the select is part of a form, once submitted it's up to the receiving 
action to use what is in the submitted parameters hash as it sees fit

Fred


 

 I see that we can use collection_tag too but they never show how to 
 recover the selected value. 

 Somebody can help me? 

 -- 
 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 unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/0908ef15-541b-440c-b6c0-39ea44a83915%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Re: HTTPI::SSLError - Plz help

2014-05-28 Thread Matt Jones


On Wednesday, 28 May 2014 08:31:41 UTC-5, Usha wrote:

 Hi plz see below for the ssl doctor script output:

 export SSL_CERT_FILE=/usr/lib/ssl/cert.pem   export 
 SSL_CERT_DIR=/usr/lib/ssl

 *ruby doctor.rb localhost*
 */usr/local/bin/ruby (1.8.7-p330)*
 *OpenSSL 0.9.8k 25 Mar 2009: /usr/lib/ssl*
 *SSL_CERT_DIR=/usr/lib/ssl*
 *SSL_CERT_FILE=/usr/lib/ssl/cert.pem*

 *HEAD https://localhost:443 https://localhost:443*
 *Error: connection refused*


Unless you've set up an SSL server on your local machine, this isn't going 
to work. Try pointing the script at the actual server that you're getting 
the SSLErrors from.

--Matt Jones
 




 On Wed, May 28, 2014 at 12:36 AM, Matt Jones al2...@gmail.comjavascript:
  wrote:



 On Tuesday, 27 May 2014 00:51:47 UTC-5, Usha wrote:

 Dear All,

 rvm ssl updated sucessfully and Openssl/ca cert seems to be correct in 
 my system but still i get  HTTPI::SSL Error, Plz help me , my environment 
 as follows:

 $ whereis openssl
 openssl: /usr/bin/openssl /usr/include/openssl 
 /usr/share/man/man1/openssl.
 1ssl.gz

 $ env | grep -i ssl
 SSL_CERT_FILE=/usr/lib/ssl/cert.pem

 $ rvm osx-ssl-certs status all
 Certificates for /usr/lib/ssl/cert.pem: Up to date.

 rvm osx-ssl-certs status all
 Certificates for /usr/lib/ssl/cert.pem: Up to date.

 $ rvm reload
 RVM reloaded


 Still it throws the following error, plz suggest how to resolve this, I 
 have spent nearly one day still cant figure out the issue, plz help me , 
 the error as follws:

 HTTPI::SSLError in searchesController
  
 SSL_connect returned=1 errno=0 state=SSLv3 read server hello A: sslv3 alert 
 handshake failure
 SSL_connect returned=1 errno=0 state=SSLv3 read server hello A: sslv3 alert 
 handshake failureRAILS_ROOT: /usha/myapp

 2.1.0/lib/httpi/adapter/httpclient.rb:28:in `request' 
 /ruby-1.8.7-p330/gems/httpi-2.1.0/lib/httpi.rb:140:in `request' 
 .rvm/gems/ruby-1.8.7-p330/gems/httpi-2.1.0/lib/httpi.rb:112:in `post' 
 /.rvm/gems/ruby-1.8.7-p330/gems/savon-2.3.2/lib/savon/operation.rb:86:in 
 `call_with_logging' .rvm/gems/ruby-1.8.7-p330/
 gems/savon-2.3.2/lib/savon/request_logger.rb:12:in `call' 
 rvm/gems/ruby-1.8.7-p330/gems/savon-2.3.2/lib/savon/request_logger.rb:12:in 
 `/.rvm/gems/ruby-1.8.7-p330/gems/savon-2.3.2/lib/savon/client.rb:36:in 
 `call'

 Any help is appreciated, Plz shed some light in this issue.


 Mislav's ssl doctor script (bottom of the post) can be useful:

 http://mislav.uniqpath.com/2013/07/ruby-openssl/

 If nothing else, posting what it outputs should provide more information 
 to troubleshoot this issue.

 --Matt Jones
  

 -- 
 You received this message because you are subscribed to the Google Groups 
 Ruby on Rails: Talk group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to rubyonrails-ta...@googlegroups.com javascript:.
 To post to this group, send email to 
 rubyonra...@googlegroups.comjavascript:
 .
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/rubyonrails-talk/4cea40d1-9c1f-44c9-aa25-11f338fbc74a%40googlegroups.comhttps://groups.google.com/d/msgid/rubyonrails-talk/4cea40d1-9c1f-44c9-aa25-11f338fbc74a%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.




-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/fb80f6ba-b4ec-46b1-9990-108acf2fc738%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: SPECIALS RELATIONSHIP!?

2014-05-28 Thread Simon Eric
Colin i try what you tell me. It work find. Thank very much.
The next step is that: if an user choice the seat on the hall, it must
not be appear againt on the view.

I have some view like this:

%= form_tag( riepilogo_path, method: post, id: sel) do %

%= hidden_field_tag sala, params[:sala] %
  %= hidden_field_tag spectacle_id, params[:spectacle_id] %

  %= hidden_field_tag num, params[:num] %
table
  tr
th/th
thNumero/th

  /tr
% for posti in @postis %
  tr
td%= check_box_tag posti_ids[], posti.id %/td
td%=h posti.numero %/td

  /tr
% end %
/table
%= submit_tag OK, id: sub%
% end %

controller of Postis is something like so:

class PostisController  ApplicationController
 def index
@postis = Posti.where(:stato = unchecked , :spectacle_id =
params[:spectacle_id] , :hall_num = params[:sala])
  end

def posti_multiple
@postis = Posti.find(params[:posti_ids])

   end
end

In the Posti's model i have attributes: spectacle_id, hall_num,
seat(integer) and stato (:default = unchecked).

An user choice her seat on the hall. When he submit the form, seats be
load in posti_ids[]. I want to update stato of seats wich are present in
posti_ids from unchecked to checked on the database. How can do
that. Thank you very much

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/114d0890991ceca48d8abb0d20cc0ffb%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Re: SPECIALS RELATIONSHIP!?

2014-05-28 Thread Colin Law
On 28 May 2014 17:22, Simon Eric li...@ruby-forum.com wrote:
 Colin i try what you tell me. It work find. Thank very much.
 The next step is that: if an user choice the seat on the hall, it must
 not be appear againt on the view.

I guess you are a beginner with rails, if so I suggest that you work
right through a good tutorial such as railstutorial.org (which is free
to use online), including doing all the exercises, so that you will
learn the basics of rails.  Then you should be able to answer most of
the basic questions yourself.

Colin

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLsaKPqNhK%2BD20aZVYy6tfEmWV0N4dy1XDrUaCruNYD8DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Beginner's routing question: Redirecting to a different controller

2014-05-28 Thread Ronald Fischer
mike2r wrote in post #1147433:
 On Wednesday, May 28, 2014 2:55:59 AM UTC-4, Ruby-Forum.com User wrote:
 --
 Posted via http://www.ruby-forum.com/.


 When you get to the point where you are going to use password
 authentication, re-read the user authentication part of the tutorial.

Thanks, I will do so. I already started to read the tutorial you 
recommended, and I must say it's really well written!

Ronald

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/c235918d076fe2a564a28a73bad69e7d%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Re: SPECIALS RELATIONSHIP!?

2014-05-28 Thread Simon Eric
Please i try this:
@postis.update_column(stato: checked)
but i have error like so:
undefined method `update_column' for #Array:0xb7a50e8

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/56a567d79dbeb667098685a4ae880a8d%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Re: Re: SPECIALS RELATIONSHIP!?

2014-05-28 Thread Colin Law
On 28 May 2014 18:00, Simon Eric li...@ruby-forum.com wrote:
 Please i try this:
 @postis.update_column(stato: checked)
 but i have error like so:
 undefined method `update_column' for #Array:0xb7a50e8

What do you think the type of @postis is?

Colin

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLsW7bgco_Zi3XkBzeuEM%2Bw%3DWMQLuK-Ke5t%2BVMd4xsh9og%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: videojs and rails

2014-05-28 Thread Pierre-Andre M.
I tried copy/pasting a sample video.js script straight from tutorial in 
a js file titled play_time.js in /assets/javascript that looks like 
this:

!doctype html
head
titleVideo.JS Example/title
link href=//vjs.zencdn.net/4.1/video-js.css rel=stylesheet
script src=//vjs.zencdn.net/4.1/video.js/script
/head
body
div style=width:700px;margin:0px auto;
video id=example_video_1 class=video-js 
vjs-default-skin
controls preload=auto width=640 height=264
poster=http://video-js.zencoder.com/oceans-clip.png;
data-setup='{controls:true}'
source 
src=http://video-js.zencoder.com/oceans-clip.mp4; type='video/mp4' /
source 
src=http://video-js.zencoder.com/oceans-clip.webm; type='video/webm' /
source 
src=http://video-js.zencoder.com/oceans-clip.ogv; type='video/ogg' /
/video
/div
/body

I then referenced the file using a tag in my /view like this:

 % javascript_include_tag play_time %

Nothing renders?!!!

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/2f47826711ab4827a123773f64ba5525%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Re: videojs and rails

2014-05-28 Thread Hassan Schroeder
On Wed, May 28, 2014 at 12:22 PM, Pierre-Andre M. li...@ruby-forum.com wrote:
 I tried copy/pasting a sample video.js script straight from tutorial in
 a js file titled play_time.js in /assets/javascript that looks like
 this:

 !doctype html
 head
 titleVideo.JS Example/title
 link href=//vjs.zencdn.net/4.1/video-js.css rel=stylesheet
 script src=//vjs.zencdn.net/4.1/video.js/script
 /head
 body
 div style=width:700px;margin:0px auto;
 video id=example_video_1 class=video-js
 vjs-default-skin
 controls preload=auto width=640 height=264
 poster=http://video-js.zencoder.com/oceans-clip.png;
 data-setup='{controls:true}'
 source
 src=http://video-js.zencoder.com/oceans-clip.mp4; type='video/mp4' /
 source
 src=http://video-js.zencoder.com/oceans-clip.webm; type='video/webm' /
 source
 src=http://video-js.zencoder.com/oceans-clip.ogv; type='video/ogg' /
 /video
 /div
 /body

Bad news: that's not javascript  :-)

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yA92Yhvy7D%2BdvO6nyLq2rW%3Dq1qyq40tRyV1gWPzOuovnw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: videojs and rails

2014-05-28 Thread Pierre-Andre M.
Understood...

Here is some pure js that I substituted into the file as well and it 
does not render either.



var endtime = 10505.89+10;
myPlayer= document.getElementById('example_video_1');
myPlayer.addEventListener('loadeddata', function(){
example_video_1.currentTime = 10505.89;
example_video_1.play();
myPlayer.addEventListener('timeupdate', function(){
if (example_video_1.currentTime = endtime) {
example_video_1.pause();
}

}, false);

}, false);


 My question is, how do I get that elementID  through my view back to 
this js file?

The video ID is instantiated when I call the video tag in my view

  video id=example_video_1 class=video-js vjs-default-skin controls 
preload=auto width=640 height=264
 poster=http://video-js.zencoder.com/oceans-clip.png;
 data-setup={}

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/2b4ac0090800a8b4a3dbf8b2182f3878%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] videojs and rails

2014-05-28 Thread Walter Lee Davis
You've already done what you need to do -- you have a matching ID in the view 
and the JS ('example_video_1'). The only thing you need to ensure now is that 
you either have an unobtrusive listener function set to encapsulate the VideoJS 
script, or you load the VideoJS script after the video is on the page, so put 
that code at the bottom of the page.

An unobtrusive listener would look like this:

document.addEventListener('load', function(){
// your video_js code here
});

That would wait until the entire page had loaded, then fire the script to 
decorate the video with the alternate playback controls. It's often a better 
idea to just put the script at the bottom of the page, since that gets around 
any sort of issues with callbacks and observers not firing for any reason, or 
stalling the loading of CSS and leading to UX issues.

Walter

On May 28, 2014, at 4:01 PM, Pierre-Andre M. wrote:

 Understood...
 
 Here is some pure js that I substituted into the file as well and it 
 does not render either.
 
 
 
 var endtime = 10505.89+10;
 myPlayer= document.getElementById('example_video_1');
 myPlayer.addEventListener('loadeddata', function(){
example_video_1.currentTime = 10505.89;
example_video_1.play();
myPlayer.addEventListener('timeupdate', function(){
if (example_video_1.currentTime = endtime) {
example_video_1.pause();
}
 
 }, false);
 
 }, false);
 
 
 My question is, how do I get that elementID  through my view back to 
 this js file?
 
 The video ID is instantiated when I call the video tag in my view
 
  video id=example_video_1 class=video-js vjs-default-skin controls 
 preload=auto width=640 height=264
 poster=http://video-js.zencoder.com/oceans-clip.png;
 data-setup={}
 
 -- 
 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 unsubscribe from this group and stop receiving emails from it, send an 
 email to rubyonrails-talk+unsubscr...@googlegroups.com.
 To post to this group, send email to rubyonrails-talk@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/rubyonrails-talk/2b4ac0090800a8b4a3dbf8b2182f3878%40ruby-forum.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/2D3A5368-4EA8-4D79-BC2F-1CE2282F97BD%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Re: videojs and rails

2014-05-28 Thread Hassan Schroeder
On Wed, May 28, 2014 at 1:01 PM, Pierre-Andre M. li...@ruby-forum.com wrote:

 myPlayer= document.getElementById('example_video_1');

  My question is, how do I get that elementID  through my view back to
 this js file?

   video id=example_video_1 ...

? It appears to already be there...

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yDUyN4SeV-m6_ZrP5RU-8Jb5imKCHCH3yARTyQKTZYUQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: videojs and rails

2014-05-28 Thread Pierre-Andre M.
Walter...thanks for your responses!

Do I not already have that here:

myPlayer.addEventListener('loadeddata', function(){...


??

For the record the javascript that i have written there works great 
within its own flatfile.  I just can't get it to render within rails so 
I know the code works...


here is my view:

 !DOCTYPE html
  html
  head
titleVideo.js | HTML5 Video Player/title
link href=video-js.css rel=stylesheet type=text/css

  /head
  body

  video id=example_video_1 class=video-js vjs-default-skin controls 
preload=auto width=640 height=264
 poster=http://video-js.zencoder.com/oceans-clip.png;
 data-setup={}

source src=/assets/test-meeting.m4v type='video/mp4' /
  /video

  /body

  % javascript_include_tag play_time %
  /html

and here is my play_time.js:


var endtime = 10505.89+10;
myPlayer= document.getElementById('example_video_1');
myPlayer.addEventListener('loadeddata', function(){
example_video_1.currentTime = 10505.89;
example_video_1.play();
myPlayer.addEventListener('timeupdate', function(){
if (example_video_1.currentTime = endtime) {
example_video_1.pause();
}

}, false);

}, false);

The video does show up and I can make it play, but this js is supposed 
to make it play from that specific time.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/e5f7e39d0b8cb50ca6c75a3acacf4fb5%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] videojs and rails

2014-05-28 Thread Walter Lee Davis
Do you have this on a public server somewhere, so we can see it in a browser 
(and more properly, in a JavaScript debugger)? You have all the piece in place, 
getting them to work together is an implementation detail and a debugging 
exercise. You are very close.

Walter

On May 28, 2014, at 4:27 PM, Pierre-Andre M. wrote:

 Walter...thanks for your responses!
 
 Do I not already have that here:
 
 myPlayer.addEventListener('loadeddata', function(){...
 
 
 ??
 
 For the record the javascript that i have written there works great 
 within its own flatfile.  I just can't get it to render within rails so 
 I know the code works...
 
 
 here is my view:
 
 !DOCTYPE html
  html
  head
titleVideo.js | HTML5 Video Player/title
link href=video-js.css rel=stylesheet type=text/css
 
  /head
  body
 
  video id=example_video_1 class=video-js vjs-default-skin controls 
 preload=auto width=640 height=264
 poster=http://video-js.zencoder.com/oceans-clip.png;
 data-setup={}
 
source src=/assets/test-meeting.m4v type='video/mp4' /
  /video
 
  /body
 
  % javascript_include_tag play_time %
  /html
 
 and here is my play_time.js:
 
 
 var endtime = 10505.89+10;
 myPlayer= document.getElementById('example_video_1');
 myPlayer.addEventListener('loadeddata', function(){
example_video_1.currentTime = 10505.89;
example_video_1.play();
myPlayer.addEventListener('timeupdate', function(){
if (example_video_1.currentTime = endtime) {
example_video_1.pause();
}
 
 }, false);
 
 }, false);
 
 The video does show up and I can make it play, but this js is supposed 
 to make it play from that specific time.
 
 -- 
 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 unsubscribe from this group and stop receiving emails from it, send an 
 email to rubyonrails-talk+unsubscr...@googlegroups.com.
 To post to this group, send email to rubyonrails-talk@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/rubyonrails-talk/e5f7e39d0b8cb50ca6c75a3acacf4fb5%40ruby-forum.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/E2D91C09-150A-4A2B-88D5-5EF2BAC3AE30%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Re: Re: SPECIALS RELATIONSHIP!?

2014-05-28 Thread Simon Eric
@postis is an string.

Now i see where i the problem. I fix them like so:
def posti_multiple
@postis = Posti.find(params[:posti_ids])
 a=Posti.find_by(numero: params[:posti_ids])
   a.update_column(:stato, checked)

end

When i have  for example posti_ids[ any number], one seat disappear on 
the view. When i have posti_ids[any number, any number, ... ], one 
seat also desappear but i don't want that. All of seat wich are choice 
must be disappear. I think i can do some loop??

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/9083efc9d4f9c985573e63e444bebaae%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] OT: Squashing Git commits AFTER pushing them

2014-05-28 Thread Jason Hsu, Rubyist
BACK STORY: I'm working on the rubygems.org site.  So far, all I've done is 
fill in the missing details on setting up the project.  (The only two files 
I've changed are config/database.yml.example and CONTRIBUTING.md.)  I 
forked the project, made changes, pushed them, and submitted a pull 
request.  You can see the pull request at 
https://github.com/rubygems/rubygems.org/pull/690 .

I was told that I need to combine my multiple commits into one.  So I used 
the git rebase command, but there's one more step that I'm missing.  I'm 
told that I merged in the master branch but didn't rebase/squash the 
commits.

When I enter git log, the output starts with:



*commit 9f341298389e64c2fec62a6400c0529d014a42b2
Merge: 738e1b7 4d366e4
Author: Jason Hsu 
Date:   Mon May 26 14:30:47 2014 -0500

Merge branch 'master' of https://github.com/jhsu802701/rubygems.org

Provided username and password in config/database.yml.example; added missing
 setup details in CONTRIBUTING.md

commit 738e1b7cdb72e4e6fe142e181e9a148d1d57f10a
Author: Jason Hsu 
Date:   Fri May 23 12:31:30 2014 -0500

Updated setup to include how to install old version of gems, how to install 
redis-server in Linux, and how to install PostgreSQL in Linux

Added complete initrd and pg_ctl commands for getting started

Changed formatting of commands to prepare Postgres

Removed indents for Postgresql setup*What else do I need to do to combine 
all of the commits I made into just one?


-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/9c5f4c69-41bd-41b7-9538-326ece9c4ca9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] OT: Squashing Git commits AFTER pushing them

2014-05-28 Thread Benjamin Iandavid Rodriguez
Check the number of commits in your PR and do the following:

$ git reset --soft HEAD~number_of_commits_in_pr
$ git commit -m some message
$ git push --force origin your_branch


Your commits should be updated on the pull request also.

Hope this helps.


2014-05-28 14:51 GMT-07:00 Jason Hsu, Rubyist jhsu802...@gmail.com:

 BACK STORY: I'm working on the rubygems.org site.  So far, all I've done
 is fill in the missing details on setting up the project.  (The only two
 files I've changed are config/database.yml.example and CONTRIBUTING.md.)  I
 forked the project, made changes, pushed them, and submitted a pull
 request.  You can see the pull request at
 https://github.com/rubygems/rubygems.org/pull/690 .

 I was told that I need to combine my multiple commits into one.  So I used
 the git rebase command, but there's one more step that I'm missing.  I'm
 told that I merged in the master branch but didn't rebase/squash the
 commits.

 When I enter git log, the output starts with:



 *commit 9f341298389e64c2fec62a6400c0529d014a42b2
 Merge: 738e1b7 4d366e4
 Author: Jason Hsu
 Date:   Mon May 26 14:30:47 2014 -0500

 Merge branch 'master' of https://github.com/jhsu802701/rubygems.org 
 https://github.com/jhsu802701/rubygems.org

 Provided username and password in config/database.yml.example; added 
 missing
  setup details in CONTRIBUTING.md

 commit 738e1b7cdb72e4e6fe142e181e9a148d1d57f10a
 Author: Jason Hsu
 Date:   Fri May 23 12:31:30 2014 -0500

 Updated setup to include how to install old version of gems, how to 
 install
 redis-server in Linux, and how to install PostgreSQL in Linux

 Added complete initrd and pg_ctl commands for getting started

 Changed formatting of commands to prepare Postgres

 Removed indents for Postgresql setup*What else do I need to do to combine 
 all of the commits I made into just one?


  --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to rubyonrails-talk+unsubscr...@googlegroups.com.
 To post to this group, send email to rubyonrails-talk@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/rubyonrails-talk/9c5f4c69-41bd-41b7-9538-326ece9c4ca9%40googlegroups.comhttps://groups.google.com/d/msgid/rubyonrails-talk/9c5f4c69-41bd-41b7-9538-326ece9c4ca9%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAHRDpXowfgAgK4sgGtJamPXpvn%2B0zVo-MxE8Rt4T4f-%2BMz0GTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Looking for some remote job

2014-05-28 Thread femto Zheng
Hello, I have some extra time in my current project,
my current project is in maintenance mode and
only take a few hours a day, so I can spare several
hours a day for new project. I'm a skilled developer
with 4 years of Java/J2EE enterprise development experience
and 6 years of Ruby/Rails development experience,
good at modeling, design, encapsulation(like OCP principle etc)
and more advanced stuff like lexing/parsing, I can develop
your project very quick and good. If you need such a worker
or you know anyone who has such needs from remotely please
contact me at femto...@gmail.com.
Thank you very much.
Best Regards

-- 
http://hi.baidu.com/femto
https://github.com/femto

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAJGhtumKTKUS5tO7e3%2BVyiMxb%2BhKfS_hzjCMTV%3D3Jf0weQzbFA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Looking for some remote job

2014-05-28 Thread greatghoul
https://weworkremotely.com/

On Thursday, May 29, 2014, femto Zheng femto...@gmail.com wrote:

 Hello, I have some extra time in my current project,
 my current project is in maintenance mode and
 only take a few hours a day, so I can spare several
 hours a day for new project. I'm a skilled developer
 with 4 years of Java/J2EE enterprise development experience
 and 6 years of Ruby/Rails development experience,
 good at modeling, design, encapsulation(like OCP principle etc)
 and more advanced stuff like lexing/parsing, I can develop
 your project very quick and good. If you need such a worker
 or you know anyone who has such needs from remotely please
 contact me at femto...@gmail.com javascript:;.
 Thank you very much.
 Best Regards

 --
 http://hi.baidu.com/femto
 https://github.com/femto

 --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to rubyonrails-talk+unsubscr...@googlegroups.com javascript:;.
 To post to this group, send email to 
 rubyonrails-talk@googlegroups.comjavascript:;
 .
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/rubyonrails-talk/CAJGhtumKTKUS5tO7e3%2BVyiMxb%2BhKfS_hzjCMTV%3D3Jf0weQzbFA%40mail.gmail.com
 .
 For more options, visit https://groups.google.com/d/optout.



-- 
 *greatghoul http://www.g2w.me - Ask and Learn!*

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAFoKNZM4aS7XC%3D6R10_-gXTGBHhxLfyW5A9_9YYN0eOroXY8Sg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] OT: Squashing Git commits AFTER pushing them

2014-05-28 Thread Jason Hsu, Rubyist
Thanks.  This worked.  Next time, I'm creating and switching to another 
branch.

On Wednesday, May 28, 2014 5:10:13 PM UTC-5, Ian_Rgz wrote:

 Check the number of commits in your PR and do the following:

 $ git reset --soft HEAD~number_of_commits_in_pr
 $ git commit -m some message
 $ git push --force origin your_branch


 Your commits should be updated on the pull request also.

 Hope this helps.


 2014-05-28 14:51 GMT-07:00 Jason Hsu, Rubyist jhsu8...@gmail.comjavascript:
 :

 BACK STORY: I'm working on the rubygems.org site.  So far, all I've done 
 is fill in the missing details on setting up the project.  (The only two 
 files I've changed are config/database.yml.example and CONTRIBUTING.md.)  I 
 forked the project, made changes, pushed them, and submitted a pull 
 request.  You can see the pull request at 
 https://github.com/rubygems/rubygems.org/pull/690 .

 I was told that I need to combine my multiple commits into one.  So I 
 used the git rebase command, but there's one more step that I'm missing.  
 I'm told that I merged in the master branch but didn't rebase/squash the 
 commits.

 When I enter git log, the output starts with:



 *commit 9f341298389e64c2fec62a6400c0529d014a42b2
 Merge: 738e1b7 4d366e4
 Author: Jason Hsu 
 Date:   Mon May 26 14:30:47 2014 -0500

 Merge branch 'master' of https://github.com/jhsu802701/rubygems.org 
 https://github.com/jhsu802701/rubygems.org
 
 Provided username and password in config/database.yml.example; added 
 missing
  setup details in CONTRIBUTING.md

 commit 738e1b7cdb72e4e6fe142e181e9a148d1d57f10a
 Author: Jason Hsu 
 Date:   Fri May 23 12:31:30 2014 -0500

 Updated setup to include how to install old version of gems, how to 
 install 
 redis-server in Linux, and how to install PostgreSQL in Linux
 
 Added complete initrd and pg_ctl commands for getting started
 
 Changed formatting of commands to prepare Postgres
 
 Removed indents for Postgresql setup*What else do I need to do to 
 combine all of the commits I made into just one?


  -- 
 You received this message because you are subscribed to the Google Groups 
 Ruby on Rails: Talk group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to rubyonrails-ta...@googlegroups.com javascript:.
 To post to this group, send email to 
 rubyonra...@googlegroups.comjavascript:
 .
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/rubyonrails-talk/9c5f4c69-41bd-41b7-9538-326ece9c4ca9%40googlegroups.comhttps://groups.google.com/d/msgid/rubyonrails-talk/9c5f4c69-41bd-41b7-9538-326ece9c4ca9%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.




-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/a73b82fd-4bb1-4e5a-9081-995a1f1fd3d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] How to make the tests pass in an elegant way? Ruby on Rails

2014-05-28 Thread James M.
I am writing a rails app with my colleague who wrote a lot of the tests.
He had to take a leave of absence due to a death in his family, and I am
needing helps with changing the model so that the tests will pass in our
spec file.

Here is the model:

class Worker  ActiveRecord::Base
  attr_accessible :first_name, :last_name

  has_many :writings
end




Here is the spec:

require 'spec_helper.rb'

describe Worker do
  describe merging two workers do
before(:each) do
  @writing1 = Writing.create!(:writing_text = Winner's note)
  @writing2 = Writing.create!(:writing_text = Loser's note)

  @winner = Worker.create!(:first_name = Jim, :last_name =
Sullivan, :email = win...@gmail.com)
  @winner.writings  @writing1

  @loser  = Worker.create!(:first_name = Tom, :last_name =
Smithe
  @loser.writings  @writing2

  @result = Worker.merge(@winner, @loser)
end

it should return the winner do
  @result.id.should eq @winner.id
end

it should not edit the winner's name do
  @result.first_name.should eq @winner.first_name
  @result.last_name.should eq @winner.last_name
end
end
end


All of these tests are failing, and I'm not sure what to do.  I don't
want to try something and accidentally break the model, as I am new to
ruby on rails.  Thanks.

Edit: Fails:

Failures:



1) Worker merging two worker should return the winner
 Failure/Error: @result = Worker.merge(@winner, @loser)
 NoMethodError:
   undefined method `merge' for #Class:0x007fb612ee2ff8
 # ./spec/models/worker_spec.rb:15:in `block (3 levels) in top
(required)'

  2) Person merging two people should not edit the winner's name
 Failure/Error: @result = Worker.merge(@winner, @loser)
 NoMethodError:
   undefined method `merge' for #Class:0x007fb612ee2ff8
 # ./spec/models/worker_spec.rb:15:in `block (3 levels) in top
(required)'

  3) Person merging two people should merge the winner's email only
if he has no email
 Failure/Error: @result = Worker.merge(@winner, @loser)
 NoMethodError:
   undefined method `merge' for #Class:0x007fb612ee2ff8
 # ./spec/models/worker_spec.rb:15:in `block (3 levels) in top
(required)'

  4) Person merging two people should not edit the winner's company
name
 Failure/Error: @result = Worker.merge(@winner, @loser)
 NoMethodError:
   undefined method `merge' for #Class:0x007fb612ee2ff8
 # ./spec/models/worker_spec.rb:15:in `block (3 levels) in top
(required)'

  5) Person merging two people should delete the loser
 Failure/Error: @result = Worker.merge(@winner, @loser)
 NoMethodError:
   undefined method `merge' for #Class:0x007fb612ee2ff8
 # ./spec/models/worker_spec.rb:15:in `block (3 levels) in top
(required)'

  6) Person merging two people should merge the notes together
 Failure/Error: @result = Worker.merge(@winner, @loser)
 NoMethodError:
   undefined method `merge' for #Class:0x007fb612ee2ff8
 # ./spec/models/worker_spec.rb:15:in `block (3 levels) in top
(required)'

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/4e599a9b0ffb692b7017713cdf40640f%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: [JOBS] Junior RoR developer (remotely)

2014-05-28 Thread Garth Gaughan
I sent you an email about this post, look forward to hearing from you.

Garth

On Saturday, May 17, 2014 12:12:34 PM UTC-7, Ruby-Forum.com User wrote:

 Hi guys, 

 The company I'm contracting at is looking for: 

 Junior Ruby on Rails developer 

 Requirements: 

 * experience with building Rails/Sinatra web applications, 

 * Experience with Javascript/jQuery (good to have: Angular, /Backbone) 

 * Experience with building  frontend part of application 

 * Good understanding of English (spoken and written) 


 Looking Forward, 

 chita.ba...@yahoo.com 

 -- 
 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 unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/dd7a8a9e-9bea-467e-8fc3-52aba0ccc025%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Integration of UPS shipping related APIs

2014-05-28 Thread Keith Poveda
I've seen several old posts referring to the integration of some of the UPS 
APIs.  Those posts with sample code are sooo dated that the UPS 
production URL's are way out of date...and I don't know what other changes 
UPS has made which may make ShippingLogic (deprecated) or Ruby Shipping 
from 2005 (http://shipping.rubyforge.org/)

Does anyone have any working examples of UPS API code?  The heavy hitters 
are:

Rating API

Street Level Address Validation API

Shipping API

Thanks,
Keith

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/09f54384-40bd-491b-9b12-efcf5c0137d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] How to make these simple tests pass in an elegant way? Ruby on Rails

2014-05-28 Thread Star Track
I am writing a rails app with my colleague who wrote a lot of the tests.  
He had to take a leave of absence due to a death in his family, and I am 
needing helps with changing the model so that the tests will pass in our 
spec file.

Here is the model:

class Worker  ActiveRecord::Base
  attr_accessible :first_name, :last_name
  
  has_many :writings
end




Here is the spec:

require 'spec_helper.rb'

describe Worker do
  describe merging two workers do
before(:each) do
  @writing1 = Writing.create!(:writing_text = Winner's note)
  @writing2 = Writing.create!(:writing_text = Loser's note)
  
  @winner = Worker.create!(:first_name = Jim, :last_name = 
Sullivan, :email = win...@gmail.com)
  @winner.writings  @writing1
  
  @loser  = Worker.create!(:first_name = Tom, :last_name = 
Smithe
  @loser.writings  @writing2
  
  @result = Worker.merge(@winner, @loser)
end

it should return the winner do
  @result.id.should eq @winner.id
end
  
it should not edit the winner's name do
  @result.first_name.should eq @winner.first_name
  @result.last_name.should eq @winner.last_name
end
end
end


All of these tests are failing, and I'm not sure what to do.  I don't want 
to try something and accidentally break the model, as I am new to ruby on 
rails.  Thanks.

Fails:

Failures:

  

1) Worker merging two worker should return the winner
 Failure/Error: @result = Worker.merge(@winner, @loser)
 NoMethodError:
   undefined method `merge' for #Class:0x007fb612ee2ff8
 # ./spec/models/worker_spec.rb:15:in `block (3 levels) in top 
(required)'

  2) Person merging two people should not edit the winner's name
 Failure/Error: @result = Worker.merge(@winner, @loser)
 NoMethodError:
   undefined method `merge' for #Class:0x007fb612ee2ff8
 # ./spec/models/worker_spec.rb:15:in `block (3 levels) in top 
(required)'

  3) Person merging two people should merge the winner's email only if 
he has no email
 Failure/Error: @result = Worker.merge(@winner, @loser)
 NoMethodError:
   undefined method `merge' for #Class:0x007fb612ee2ff8
 # ./spec/models/worker_spec.rb:15:in `block (3 levels) in top 
(required)'

  4) Person merging two people should not edit the winner's company name
 Failure/Error: @result = Worker.merge(@winner, @loser)
 NoMethodError:
   undefined method `merge' for #Class:0x007fb612ee2ff8
 # ./spec/models/worker_spec.rb:15:in `block (3 levels) in top 
(required)'

  5) Person merging two people should delete the loser
 Failure/Error: @result = Worker.merge(@winner, @loser)
 NoMethodError:
   undefined method `merge' for #Class:0x007fb612ee2ff8
 # ./spec/models/worker_spec.rb:15:in `block (3 levels) in top 
(required)'

  6) Person merging two people should merge the notes together
 Failure/Error: @result = Worker.merge(@winner, @loser)
 NoMethodError:
   undefined method `merge' for #Class:0x007fb612ee2ff8
 # ./spec/models/worker_spec.rb:15:in `block (3 levels) in top 
(required)'


-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/9db48dda-76b2-490f-bb4f-bcff90cb9a60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Sharing Rails 4 session with a Rails 4.1 App

2014-05-28 Thread Jordan Humphreys
Hello Folks,

I'm curious if it is possible to share a Rails 4 session with a Rails 4.1 
application with the same secret key base on the same domain name. This 
works with Rails 4 to Rails 4 but it appears that my cookies are being 
encrypted differently between the two versions. Any ideas?

Jordan

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/7200970e-3b2f-4099-bdff-b6593bb3a59f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] live streaming picture wihout refresh

2014-05-28 Thread Ovunc Yildirim
Hello,

application creates a picture and I need to send this created picture to 
client without refresh. if client rotates the picture new generated one 
should be send from backend and new generated image should be updated in 
place. 
Can I use rails live streaming for this set up? maybe encode 64 to json and 
send it via live stream to client?
Any suggestions?

thanks in advance 
Ovunc

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/cd9a0228-8901-44b6-a23c-1a2fd1b1546d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Not able to test cron job in development using Whenever gem in rails 3

2014-05-28 Thread Ankur Kumar
Any help on this will be greatly appreciated! Thanks.

--
Regards,
Ankur

On Wed, May 28, 2014 at 10:18 AM, Ankur Kumar specialan...@gmail.comwrote:


  I did the following to implement cron jobs in rails 3 using a runner
 instead of a rake task.

 *Step 1:* I have whenever gem installed and scheduler.rb has following:

   set :environment, 'development'
   set :output, {
  :error= /log/error.log,
  :standard = /log/cron.log
   }

   every 1.minute do
   runner Cron.sendAutomaticsSMS()
   end

 *Step 2:*

 Cron file: lib/cron.rb

 class Cron  ActiveRecord::Base

   def **sendAutomaticsSMS**()
  some code here ---
   end
 end

 *Step 3:*

 whenever --update-crontab --set environment=development

  This updates crontab file.

 *Step 4:*

 Checked contents of crontab file using:

 crontab -e

  It opens cron tab file which has details of cron job method to be invoked:
 --

 # Begin Whenever generated tasks for: store

 # End Whenever generated tasks for: store

 # Begin Whenever generated tasks for: 
 /code/rails_projects/new/bhk/bigbhk- dev/config/schedule.rb
 * * * * * /bin/bash -l -c 'cd *RAILS_APP_PROJECT_LOCATION*  
 script/rails runner -e development '\''**Cron.sendAutomaticsSMS()**'\'' $

 # End Whenever generated tasks for: 
 /code/rails_projects/new/bhk/bigbhk-dev/


  *Step 5:*

 Running cron job:

 $sudo service cron restart

 cron stop/waiting
 cron start/running, process 4027

  This does not do anything. I wait for operation as defined in
 sendAutomaticsSMS() method to execute but the cron doesn't even enter this
 method.

 I don't see any error in log/development.log and there is no log/cron.log
 in my rails app.

 Posted this question on 
 Stackoverflowhttp://stackoverflow.com/questions/23880580/not-able-to-test-cron-job-using-whenever-gem-in-rails-3as
  well.
  Thanks.
 --
 Regards,
 Ankur



-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CALSL1ePBjMdg%2B6f5kU-LDor3x4vQcd14jFuuCPGC_1KCVwKQ%2BQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.