Ruby on Rails Wednesday, July 31, 2013

i am trying to create some JSON services for a legacy database i have in
firebird.

I have installed firebird adapter and it seems it is working but is
always throwing an error:

Fb::Error: Undefined name Dynamic SQL Error SQL error code = -204 Table
unknown MSFCLIENTES At line 1, column 45 : SELECT "MSFCLIENTES".* FROM
"MSFCLIENTES" ORDER BY "MSFCLIENTES"."ID" ASC ROWS 1

the log shows like if it is quering the wrong table "RDB$DATABASE" (one
of the system tables), so if i change the table name to that table it
works but it isnt the table i need...

here is my model

class Client < ActiveRecord::Base

establish_connection(
:adapter => "fb",
:database => "localhost:/var/databases/MSFBASE.Ib",
#:database => "sales",
:username => "SYSDBA",
:password => "masterkey",
:charset => "NONE")

self.table_name = "MSFCLIENTES"
#self.primary_key = 'RDB$RELATION_ID'
#self.table_name = "RDB$DATABASE"
#self.primary_key = 'RDB$RELATION_ID'
# self.table_name = 'employee'

end

--
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+unsubscribe@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/2dd056196c35739f23bc433adebc76cd%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Hello Ma'am,



Is there any opening for freshers ? I 'm very much interested in working on rails.


On Friday, 26 July 2013 13:20:24 UTC+5:30, Shruthi Rangaraj wrote:
Hi,

Am heading the recruitment for an IT Company. Tavant Technologies is an IT solutions and services provider that employs cutting-edge and emerging technologies to provide game-changing results for its customers. Tavant specializes in building solutions and providing end-to-end services in the domain of Service Operations, Consumer Lending, eBusiness and Trading & Securities. Tavant's suite of products and services are routinely rated high by the industry & media and deployed by leading business names, like Electronic Arts, TiVo, MLB AM, New York Times, Ingersoll Rand, Bobcat, Federal Signal and many more. Tavant is an ISO 27001 compliant and SEI-CMMI level 4 compliant organization. Tavant's employees delight their customers through their passion and excellence. Every time. Without exception.  

Currently we are looking for resources who specialize on ROR skills. Please contact me for any further details.

Please find the JD Below

Skill Set

Detailed job Description

Ruby on Rails 

 

·         BS/MS with 4-5 years of web application development in Ruby on Rails

·         Design and implement new features and optimize existing ones from controller-level to UI

·         Experience building large scale systems in a high availability production environment

·         Must have excellent hands-on experience building Ruby on Rails based web applications

·         Good understanding of Object Orient design principles, MVC architecture, and web-services RESTful APIs and design patterns.

·         Excellent knowledge of version control systems like GIT, SVN

·         Excellent analytical and problem solving skills

·         Outstanding written and verbal communication and interpersonal skills

·         Experience with agile methodologies like SCRUM

·         Experience using databases like MongoDB

·         Exposure to cloud computing platforms like Amazon

·         Knowledge of message queues

 


Regards
Shruthi Rangaraj

--
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+unsubscribe@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/e05e12b2-b6c9-4155-95e1-3b3b4da07277%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

Hey all,


This is Pallavi from Bangalore . I hold a BE degree from BMSIT in Computer science stream. I passed out in june 2013 .
It would be nice if you guys can help me find a job in startups working on Rails. I'm one of the fellow student of Rails girls summer of code (RGSoC) 2013.

Thank you.

--
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+unsubscribe@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/23ee33c5-e921-4ff9-a5e4-612eef81fc41%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

Hi all. I'm using CanCan for my app authorization and need to know how
to protect privacy between users.

Say I have the following three users:

Alice
Bob
Charlie

Alice is an admin and should be able manage everything. Bob and Charlie
are regular users and should be prevented from getting the index of
users, and only be able to manage their own record. For example Bob
should not be able to directly access any information about Charlie nor
Alice.

class Ability
include CanCan::Ability

def initialize(user)
user ||= User.new # guest user (not logged in)
if user.admin?
can :manage, :all
else
can :read, :all
end
end
end

Obviously these "default" abilities are not sufficient. Anyone could get
the "index" of users or the "show" of any user. I need to restrict
non-admins to the "show", "edit" & "update" of themselves, but have no
access to anyone else.

I'm just not sure how to define these abilities.

--
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+unsubscribe@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/9a5d2ef53e344f2ebcf981893ac2d468%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Google for "geocode services"

On Jul 31, 2013, at 7:06 AM, Ajit Teli <lists@ruby-forum.com> wrote:

> Hi,
>
> I would like to get the lat/long boundaries for each reverse Geo-coded
> address. For example,
>
> Lat: 14.32826, Lng: 77.643127 pair gives reverse Geo-coded address as
> "Kanyakumari Road, Andhra Pradesh 515101, India". There will be list of
> other lat/long pairs which will produce same reverse Geo-coded address
> as above. And I assume that for each reverse Geo-coded address there
> will be lat/long boundary.
>
> So, please let me know how can I get lat/long boundaryies for a pair
> of lat/long which will produce same reverse Geo-coded address.
>
> Thank You
> Ajit
>
> --
> 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+unsubscribe@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/ae48dd0985cdb4cb8ee0a82afaef961d%40ruby-forum.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
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+unsubscribe@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/0400BF1C-3C54-4B57-805F-568C390933B7%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On Jul 29, 2013, at 8:53 AM, southierobert@gmail.com wrote:
> With PHP applications (only experience I had before), all I needed to do is to FTP all required files, create MySQL username/pass & upload SQL structure, add this username/pass in any given config file of the php script and the app worked.

Yes, deploying PHP is quite simple compared to Rails.

> Can you tell me what are standard/proper steps required to deploy an app that I worked on my local Ubuntu machine and want to have it working on 'standard' web hosting company that does not specialize in Rails app hosting?

I don't have anything written (which I should) but just googling around, here's a few:

* http://blog.sudobits.com/2013/01/07/how-to-deploy-rails-application-to-vps/
* http://rubysource.com/deploying-a-rails-application/
* http://tommy.chheng.com/2013/01/23/deploying-a-rails-app-on-nginxpuma-with-capistrano/

There's also a pragprog book: http://pragprog.com/book/cbdepra/deploying-rails which I haven't read.

If you hosting solution does not offer shell access, it's going to be very difficult, I think to do an effective deploy. Even moreso if your application requires gems that need to have native extensions compiled.

There are some great Rails-hosting PaaS out there: heroku, EngineYard, CloudFront, etc.

My most recent job, we used AWS to host our app, and deployed using Chef (opscode.com) which was really nice to work with.

--
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+unsubscribe@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/693B196C-FC17-453D-8703-206D63FC2DE6%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On Wed, Jul 31, 2013 at 12:26 PM, <southierobert@gmail.com> wrote:
> What is most popular way to deploy apps on non-Heroku machine that has
> standard Apache/MySQL setup?

One option: http://www.capistranorb.com/

--
Hassan Schroeder ------------------------ hassan.schroeder@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+unsubscribe@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/CACmC4yAEhurnsFcVUD2dCowP3N%2BiyPac88VeKkp239eSZurTVQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

What is most popular way to deploy apps on non-Heroku machine that has standard Apache/MySQL setup? I would like to be able to deploy my apps (as I learn Rails) to my own dedicated machines. I have already installed Ruby, & rails gem, and I'm able to create apps on that machine without any issues. It is when I develop something localy when I face issue as I don't know how to deploy it "properly"? Do I simply upload entire app folder structure over FTP, run bundle install, config database, and start the app OR is there a faster/easier way?



On Wednesday, July 31, 2013 4:06:05 AM UTC-4, Frederick Cheung wrote:

On Monday, July 29, 2013 2:53:42 PM UTC+1, southi...@gmail.com wrote:
> Hi,
>  
> With PHP applications (only experience I had before), all I needed to do is to FTP all required files, create MySQL username/pass & upload SQL structure, add this username/pass in any given config file of the php script and the app worked.
>  
> Can you tell me what are standard/proper steps required to deploy an app that I worked on my local Ubuntu machine and want to have it working on 'standard' web hosting company that does not specialize in Rails app hosting?
>  

While there are many ways of deploying rails applications, it's extremely unlikely that a non rails specialist will have installed/configured any of them. If you're looking for an easy way to deploy a rails app, it's hard to beat heroku for simplicity.

Fred


> Thanks,
>  
> Rob

--
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+unsubscribe@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/5734b792-eb1e-427b-9dc6-9805bc678ddd%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

I am building a site for users where these can create a bunch of scaffolds and for each scaffold the user can create a bunch of tracks. Now, it should be possible for a user to share scaffolds with other users (this is were I am stuck). Same for tracks.


So the main resources are users, scaffolds and tracks and since I want to display an index for each of these I have chosen nested routes so in the routes.rb file I have:

resources :users do
  resources :scaffolds do
    resources :tracks
  end
end

I have the the following models and corresponding controllers and views:

user
scaffold
track

In the models user has_many :scaffolds, scaffold has_many :tracks and belong_to :user and track belong_to :scaffold

For the sharing I have a scaffold_relationship and a track_relationship model both with sharing and shared attributes in which I can store user_id and scaffold_id/track_id. Thus I can use the has_many :scaffold_relationships, foreign_key: "shared_id" and has_many :sharing, through :scaffold_relationships. Same for the track_relationship.

However, I am unsure if this is the way to go. I think I want separate scaffold and track sharing pages, and maybe it is better with separate resources for the relationships? In any case I am stuck with planning the correct routes.

Help appreciated.

--
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+unsubscribe@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/76c65b00-0a69-4a11-93a3-c4d819609f84%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

Thanks lot bacrossland .

Best Regards
Fahim


Answers
 
1. It is default feature of the browser. The browser will ask you if you want your password remembered for this site. If you click yes then it will store the site URL, login ID and password into a keychain file. That keychain file will be used to auto populate the login fields the next time you come navigate to the page and are presented with the login prompt.

2. Remember me stores your authentication token as a cookie on your system. As long as you don't click logout, clear your cookies, or have not exceeded the time that the cookie will be stored each time authentication is prompted, for instance if your session times out, then you will be auto logged back in. Its function is more like "keep me logged in". 

On Tuesday, July 30, 2013 1:18:16 PM UTC+5:30, Fahim Patel wrote:
Hi all,

I have setup all the devise configuration. But facing issue in remember me.
I check remember me checkbox before sign in and I can see cookie is created and user table is also get updated .

But when I logout no sign in detail is present in email and password input box , and cookie also get destroyed.

I uncomment below line code also -
# The time the user will be remembered without asking for credentials again.
  config.remember_for = 2.weeks

Thanks for help.


Best Regards
Fahim Babar Patel




--
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+unsubscribe@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/4fc4dad4-c51e-456b-ad4d-ad6a3ed887cf%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

Hello all,
  I get the following error
--
Started GET "/" for 127.0.0.1 at 2013-07-31 11:01:25 -0400
Processing by HomeController#index as */*
  Rendered home/index.html.haml within layouts/application (85.0ms)
Warning. Error encountered while saving cache 86b3fe7c2060008df4ecf7c83b1194891f643520/application.css.sassc: can't dump anonymous class #<Class:0x4f
1392c5>
/home/ravi/.rbenv/versions/jruby-1.7.4/lib/ruby/gems/shared/gems/sprockets-2.10.0/lib/sprockets/context.rb:282 warning: singleton on non-persistent J
ava type Java::JavaLang::InternalError (http://wiki.jruby.org/Persistence)
Completed 500 Internal Server Error in 30082ms
--

* I've tried wiping everything from the tmp/ directory
* I've tried setting config.sass.cache = false in my environment files

Nothing has worked.  I keep getting this error.

Using:
* jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on OpenJDK 64-Bit Server VM 1.7.0_40-b31 +indy [linux-amd64]
* rbenv for everything else
** Sass 3.2.10 (Media Mark)
** sass-rails 4.0.0
** Rails 4.0.0

How do I fix this?  I just want to turn caching off and move on with my development.

TIA
-ravi

--
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+unsubscribe@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/627adc06-3ab1-4515-852f-2fc8d252eb24%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

I have a model in my RoR app. Two of the attributes of this model is username and password, which are the login details of an already installed Joomla site. I would like to use a form in RoR app and when the user click on the submit button to get these details from my app and post them to Joomla login form and submit to login to Joomla backend. I am searching about the method i should use. If i have to use Javascript, which is the way to do it?

I have some knowledge in RoR but never done something like this before.

Thank you very much, in advance.

--
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+unsubscribe@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/3394f62c-7855-4df5-9ab0-790dd1df4bda%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

Questions

  1. Did Save password prompt which come after successful sign in is default feature of browser or is effect of rememberable feature ?
  2. How does remember me work than ?
Answers
 
1. It is default feature of the browser. The browser will ask you if you want your password remembered for this site. If you click yes then it will store the site URL, login ID and password into a keychain file. That keychain file will be used to auto populate the login fields the next time you come navigate to the page and are presented with the login prompt.

2. Remember me stores your authentication token as a cookie on your system. As long as you don't click logout, clear your cookies, or have not exceeded the time that the cookie will be stored each time authentication is prompted, for instance if your session times out, then you will be auto logged back in. Its function is more like "keep me logged in". 

--
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+unsubscribe@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/b67e5080-baa4-4a88-8d3f-08d1997c9824%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

Ajit Teli wrote in post #1117253:
> Hi,
>
> I would like to get the lat/long boundaries for each reverse Geo-coded
> address. For example,
>
> Lat: 14.32826, Lng: 77.643127 pair gives reverse Geo-coded address as
> "Kanyakumari Road, Andhra Pradesh 515101, India". There will be list of
> other lat/long pairs which will produce same reverse Geo-coded address
> as above. And I assume that for each reverse Geo-coded address there
> will be lat/long boundary.

Why would you assume this? Latitude and longitude describe a precise
point (within the tolerance provided by the system). Addresses
(especially as defined by the Google Maps API) are imprecise. For
example "Georgia" is a valid address, as defined by Google Maps. It is
also an ambiguous address. Does it mean the United States state of
Georgia or the country in Asia? The API provides for region biasing to
disambiguate such addresses.

It would be impractical to provide a list of all Lat/Lon pairs for an
address. Theoretically that would be an infinitely long list. That is
like asking to list every point inside a rectangle. That would also
result in an infinitely long list.

Reverse geocoding a point into an address is a lot more "fuzzy." Google
Maps attempts to provide reasonable results by retuning the "best"
address for a given point, along with other addresses within the region
surrounding the given point. Unlike geo-points, addresses are finite.
There are only a limited number of them within any given region.

> So, please let me know how can I get lat/long boundaryies for a pair
> of lat/long which will produce same reverse Geo-coded address.

Taking a quick look at the Google Maps API I didn't see anything that
would directly give you what you want. As I described above I don't even
think this makes sense.

--
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+unsubscribe@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/8ea13f724683b1e444168f1d5860ec56%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Hi,

I would like to get the lat/long boundaries for each reverse Geo-coded
address. For example,

Lat: 14.32826, Lng: 77.643127 pair gives reverse Geo-coded address as
"Kanyakumari Road, Andhra Pradesh 515101, India". There will be list of
other lat/long pairs which will produce same reverse Geo-coded address
as above. And I assume that for each reverse Geo-coded address there
will be lat/long boundary.

So, please let me know how can I get lat/long boundaryies for a pair
of lat/long which will produce same reverse Geo-coded address.

Thank You
Ajit

--
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+unsubscribe@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/ae48dd0985cdb4cb8ee0a82afaef961d%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Hi All,


We are starting a new project which will have lots of forms. Each form will represent a single table, but will have many associations to other models. 

This form's fields can be extended on the fly. Versions needs to tracked for the models and any point of time the version can be reverted back.

Is there any proper gems available for this ? I was thinking to use acts_as_versioned. But I need the models to be extended. 

And more complex thing is that we need a way to filter / sort based on that extended field. 

Thanks in advance.

With Best Regards,
Senthil

--
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+unsubscribe@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/976f43f7-2a7b-49c9-bc72-dbd9c5b7424a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

On Monday, July 29, 2013 2:53:42 PM UTC+1, southi...@gmail.com wrote:
> Hi,
>  
> With PHP applications (only experience I had before), all I needed to do is to FTP all required files, create MySQL username/pass & upload SQL structure, add this username/pass in any given config file of the php script and the app worked.
>  
> Can you tell me what are standard/proper steps required to deploy an app that I worked on my local Ubuntu machine and want to have it working on 'standard' web hosting company that does not specialize in Rails app hosting?
>  

While there are many ways of deploying rails applications, it's extremely unlikely that a non rails specialist will have installed/configured any of them. If you're looking for an easy way to deploy a rails app, it's hard to beat heroku for simplicity.

Fred


> Thanks,
>  
> Rob

--
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+unsubscribe@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/f751d1e8-38ef-408b-9071-774a77634836%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On Wednesday, July 31, 2013 5:21:56 AM UTC+1, Ruby-Forum.com User wrote:
> Hi everyone,
>
>
>
> I am having a problem with running rake tasks that involve threads.
>
> Everytime I run it, I get an uninitialized constant with one of my
>
> models (changes models occasionally) seems to be uninitialized.
>
>
>
> I have tried to fix this by adding config.threadsafe! in the
>
> application.rb. That did not work. So I tried to add
>
> Rails.application.eager.load! and that did not work. I have tried to put
>
> config.dependency_loading = true if $rails_rake_task but that does not
>
> work. I have tried config.threadsafe! unless $rails_rake_task but that
>
> did not work also.
>
>

Loading classes is inherently a thread unsafe task - you run into all sorts of race conditions. While rails has mechanisms for loading all code upfront (it does that in production by default), and this is one of the things that config.threadsafe! does. My recollection is that this disabled for rake tasks though - I don't recall the precise reasons though. If all else fails, you could use require_dependency to load all of the classes you'll need ahead of time.

Fred.

>
> I was wondering if anyone has come across this problem in which you are
>
> using threads in a rake file and you get the uninitialized constant on
>
> one of your models. Please help! I went through all the
>
> stackoverflow pages related to this and nothing works :( I have ruby
>
> 1.9.3-p429, rails 3.2.13, rubygem 2.0.6
>
>
>
> --
>
> 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+unsubscribe@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/2cd63ede-868f-4af5-b00a-99a77c72faf5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails Tuesday, July 30, 2013

It means remember me is working 

I am confusing between remember me and save password prompt which come after successful sign in.
Question's
  1. Did Save password prompt which come after successful sign in is default feature of browser or is effect of rememberable feature ?
  2. How does remember me work than ?

Thanks

Best Regards
Fahim Babar Patel

--
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+unsubscribe@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/682f770a-0989-40aa-9121-a569646cd9bf%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

Thanks lot  bacrossland  for your input.

On Tuesday, July 30, 2013 1:18:16 PM UTC+5:30, Fahim Patel wrote:

Hi all,

I have setup all the devise configuration. But facing issue in remember me.
I check remember me checkbox before sign in and I can see cookie is created and user table is also get updated .

But when I logout no sign in detail is present in email and password input box , and cookie also get destroyed.

I uncomment below line code also -
# The time the user will be remembered without asking for credentials again.
  config.remember_for = 2.weeks

Thanks for help.


Best Regards
Fahim Babar Patel




--
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+unsubscribe@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/91673ade-b854-4cbe-a4ec-61c98a9b4f84%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

Hi everyone,

I am having a problem with running rake tasks that involve threads.
Everytime I run it, I get an uninitialized constant with one of my
models (changes models occasionally) seems to be uninitialized.

I have tried to fix this by adding config.threadsafe! in the
application.rb. That did not work. So I tried to add
Rails.application.eager.load! and that did not work. I have tried to put
config.dependency_loading = true if $rails_rake_task but that does not
work. I have tried config.threadsafe! unless $rails_rake_task but that
did not work also.

I was wondering if anyone has come across this problem in which you are
using threads in a rake file and you get the uninitialized constant on
one of your models. Please help! I went through all the
stackoverflow pages related to this and nothing works :( I have ruby
1.9.3-p429, rails 3.2.13, rubygem 2.0.6

--
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+unsubscribe@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/a547c1c61bc0631fe94f9a76b320446a%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On Monday, July 29, 2013 5:03:13 PM UTC-5, Ruby-Forum.com User wrote:

Hi All,

I'm making a Rails app in which users have folders in which to organize
journal entries. I'm trying to load a partial into view that displays
D3.js visualizations based on the character count of each journal entry.
The JavaScript code and HTML inject properly, but I don't think the JS
is executing.

Show.js.erb looks like this:
$("#actual-right").append( "<%=j render :partial => 'contents', :locals
=> {:folder => @folder } %>" );

$("#jscripts").append("<%=j render :partial => 'show', formats: :js,
:locals => {:folder => @folder} %>");

The second line appends _show.js.erb with the rest of my JavaScript in
application.html.erb. The top line appends some HTML tags for D3.

I need to figure out how to execute the JavaScript so when a user clicks
the link to one of their folders, the HTML and JS are injected and the
graphs are drawn. Attached is my _show.js.erb file -- I have tried
wrapping all the D3 code in a function and calling it at the bottom, but
that didn't work.

Any advice would be appreciated!

Attachments:
http://www.ruby-forum.com/attachment/8638/_show.js.erb

 You can try wrapping your javascript function calls in a jQuery document.ready call. It'll fire off when the document object model is ready. 

--
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+unsubscribe@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/bfc4a034-f05d-48b5-a0ba-0146e5bf6935%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails



On Tuesday, July 30, 2013 2:48:16 AM UTC-5, Fahim Patel wrote:

Hi all,

I have setup all the devise configuration. But facing issue in remember me.
I check remember me checkbox before sign in and I can see cookie is created and user table is also get updated .

But when I logout no sign in detail is present in email and password input box , and cookie also get destroyed.

I uncomment below line code also -
# The time the user will be remembered without asking for credentials again.
  config.remember_for = 2.weeks

Thanks for help.


Best Regards
Fahim Babar Patel


Hi Fahim,

remember_for is for automatic login. If you log out it doesn't apply. Having the credentials auto fill in the fields after a logout is handled by the browser. Here is a link to the code that uses it: https://github.com/plataformatec/devise/blob/master/lib/devise/models/rememberable.rb

The comment block has instructions on how the setting is used.

# Rememberable manages generating and clearing token for remember the user
    # from a saved cookie. Rememberable also has utility methods for dealing
    # with serializing the user into the cookie and back from the cookie, trying
    # to lookup the record based on the saved information.
    # You probably wouldn't use rememberable methods directly, they are used
    # mostly internally for handling the remember token.
    #
    # == Options
    #
    # Rememberable adds the following options in devise_for:
    #
    # * +remember_for+: the time you want the user will be remembered without
    # asking for credentials. After this time the user will be blocked and
    # will have to enter his credentials again. This configuration is also
    # used to calculate the expires time for the cookie created to remember
    # the user. By default remember_for is 2.weeks.

 If you set this option it should remember you between browser closes. Again for your id and password to be auto filled in the field between logouts, which are different than browser closes or navigating away from the page, that is handled by the browser. 

I hope this helps.

Thanks,
Bryan

--
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+unsubscribe@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/f918e5f4-e63b-4ae7-9b90-75d463fccd34%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

I have a client in Greenwich, CT looking for a seasoned Ruby on Rails Developer for a full time, on-site, salaried position paying to 130k + benefits. Local candidates preferred, but applicants interested in relocating considered too. Relocation costs covered. US Citizens or Green Card holders only please. Full job/client details shared with qualified applicants. Thank you.  

Responsibilities: 

* 5+ years of general web development experience and 1+ years of Ruby on Rails experience required 
* Excellent understanding of the MVC architecture and OOP design and principles 
* Strong background in HTML, CSS and JavaScript. Comfortable with SQL 
* Experience with bug tracking and version control software 
* Comfortable working in a team environment 

If you are interested in this job, please submit your resume and salary requirements to opensourcestaffing|AT|gmail.com 

Thank you, 
Beauregard Gould 
opensourcestaffing|AT|gmail.com 
http://osjobs.wordpress.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+unsubscribe@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/9cefab78-cfc2-46ee-9ba3-371171b6c2bd%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

hi Bryan
its not coming.

kanna(9742665400)...........


On 30 July 2013 19:14, Matt Jones <al2o3cr@gmail.com> wrote:


On Monday, 29 July 2013 11:01:32 UTC-4, kanna wrote:
hi i passed name and value in link_to but its not taking?

<%if params[:deals][:company_name] !=nil && params[:deals][:company_name] == "dsec" %>
            <%= link_to "Company Name d","javascript:void(0)",:class=>"get_page decending",:name=>"deals[company_name]",:value=>"asc","data-url"=>"1","data-searchurl"=>"/deals/search" %>
            <%elsif params[:deals][:company_name] !=nil && params[:deals][:company_name] == "asc"%>
            <%= link_to "Company Name a","javascript:void(0)",:class=>"get_page ascending",:name=>"deals[company_name]",:value=>"dsec","data-url"=>"1","data-searchurl"=>"/deals/search" %>
            <%else%>
            <%= link_to "Company Name n","javascript:void(0)",:class=>"get_page",:name=>"deals[company_name]",:value=>"dsec","data-url"=>"1","data-searchurl"=>"/deals/search" %>
            <%end%>


in browser 
<a class="get_page" value="dsec" name="deals[company_name]" data-url="1" data-searchurl="/deals/search" href="javascript:void(0)">Company Name n</a>


The values appear in the link tag, just as you requested. Perhaps you're intending to pass them as parameters to /deals/search somehow? 

To help people answer this question, you should include the Javascript code that's reading data-url and data-searchurl so that it can be determined exactly what that code is looking for...

--Matt Jones

PS: multiple-posting your question is not generally considered a useful way to produce answers faster. :) 

--
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+unsubscribe@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/70695f1e-5ed4-469d-a2e4-d4af66b5a943%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
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+unsubscribe@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/CAPtiWRBEek1hG3do3s8bzj%3DcN5_2C%2Bx4D5OQ0FWMCzyztv%2BErw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails



On Monday, 29 July 2013 11:01:32 UTC-4, kanna wrote:

hi i passed name and value in link_to but its not taking?

<%if params[:deals][:company_name] !=nil && params[:deals][:company_name] == "dsec" %>
            <%= link_to "Company Name d","javascript:void(0)",:class=>"get_page decending",:name=>"deals[company_name]",:value=>"asc","data-url"=>"1","data-searchurl"=>"/deals/search" %>
            <%elsif params[:deals][:company_name] !=nil && params[:deals][:company_name] == "asc"%>
            <%= link_to "Company Name a","javascript:void(0)",:class=>"get_page ascending",:name=>"deals[company_name]",:value=>"dsec","data-url"=>"1","data-searchurl"=>"/deals/search" %>
            <%else%>
            <%= link_to "Company Name n","javascript:void(0)",:class=>"get_page",:name=>"deals[company_name]",:value=>"dsec","data-url"=>"1","data-searchurl"=>"/deals/search" %>
            <%end%>


in browser 
<a class="get_page" value="dsec" name="deals[company_name]" data-url="1" data-searchurl="/deals/search" href="javascript:void(0)">Company Name n</a>


The values appear in the link tag, just as you requested. Perhaps you're intending to pass them as parameters to /deals/search somehow? 

To help people answer this question, you should include the Javascript code that's reading data-url and data-searchurl so that it can be determined exactly what that code is looking for...

--Matt Jones

PS: multiple-posting your question is not generally considered a useful way to produce answers faster. :) 

--
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+unsubscribe@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/70695f1e-5ed4-469d-a2e4-d4af66b5a943%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

Originally posted here

I am using Rails 3.2.1 where I have to include few controller and action specific javascripts which I am doing using a javascript_template_manager.html.haml and calling this at the bottom of the page. Now I want to combine all these js into one to reduce the http request. I am using asset pipeline.

How can I combine controller specific js into one precompiled file?

Here is how my _javascript_template_manager.html.haml file looks like:

 %noscript    :css      #container{ display:none; }    = render :partial => "/widgets/common/javascript_disabled"      = jquery_include_tag :google   = javascript_include_tag "common"    / condetional javascripts for the app  - if params[:controller] == "settings"    = javascript_include_tag "plugins/jQuery-cookie"    - if params[:controller] != "people" and params[:controller] != "companies"    = javascript_include_tag "plugins/iphone-style-checkboxes"    - if params[:controller] == 'users' || params[:controller] == 'companies'    = javascript_include_tag "plugins/best_in_place"    - if params[:controller] == 'letters' || params[:controller] == 'companies'    = javascript_include_tag "plugins/jquery.autoSuggest"    - if params[:controller] == 'people' || params[:controller] == 'letters' || params[:controller] == 'users' || params[:controller] == 'companies'    = javascript_include_tag "plugins/areacomplete"    = javascript_include_tag "application"

Now I want to combine all the above javascript files into one or what is the best way to do it?

- deepak 

--
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+unsubscribe@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/efe2a576-db41-459e-9462-4cb358e33799%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

I have a controller `SuperPower` that is responsible for the paths under
`/super-power`, and not the canonical `/super_power` (notice the hyphen
instead of the underscore).

In my `routes.rb` I have

resources 'super-power', as :super_power

My `super_power_test.rb` contains

class SuperPowerControllerTest < ActionController::TestCase
test "shows all available" do
get :index

assert_not_nil assign(:powers)
end
end

and the test fails with

# Running tests:

[1/1] SuperPowerControllerTest#test_shows_all_available = 0.08 s
1) Error:
test_shows_all_available(SuperPowerControllerTest):
ActionController::RoutingError: No route matches
{:controller=>"super_power"}

The test fails because it doesn't use the correct path `/super-power`
but uses the canonical `/super_power`.

Is there a way to associate the tests of a controller to a certain path?
Is there a way to make this change for all the tests?

--
Gioele Barabucci <gioele@svario.it>

--
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+unsubscribe@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/kt8f3p%24lu1%241%40ger.gmane.org.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails



On Tuesday, July 30, 2013 1:18:16 PM UTC+5:30, Fahim Patel wrote:

Hi all,

I have setup all the devise configuration. But facing issue in remember me.
I check remember me checkbox before sign in and I can see cookie is created and user table is also get updated .

But when I logout no sign in detail is present in email and password input box , and cookie also get destroyed.

I uncomment below line code also -
# The time the user will be remembered without asking for credentials again.
  config.remember_for = 2.weeks

Thanks for help.


Best Regards
Fahim Babar Patel


When I sign_in then save password prompt occur and when I save it and logout then I can see email and password is present there.
Don't know why it is not working with remember me check box ?

Any help will appreciate.

Thanks

Best Regards
Fahim Babar Patel

--
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+unsubscribe@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/57c09ee7-aafd-4494-b5b8-e55b4855c0b9%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

Hi all,


I have setup all the devise configuration. But facing issue in remember me.
I check remember me checkbox before sign in and I can see cookie is created and user table is also get updated .

But when I logout no sign in detail is present in email and password input box , and cookie also get destroyed.

I uncomment below line code also -
# The time the user will be remembered without asking for credentials again.
  config.remember_for = 2.weeks

Thanks for help.


Best Regards
Fahim Babar Patel




--
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+unsubscribe@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/c3fe493d-963e-4bda-a1f0-1dc76ade2b60%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.