Ruby on Rails Saturday, December 31, 2011

Found the answer: provided there is an 'assets' subdirectory in the
'myapp/public' directory, it will work and it does work :)

Case closed :)


Happy new year :)

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hi, all :)

Happy new year :)

I referred to http://edgeguides.rubyonrails.org/asset_pipeline.html
for rails 3.1.0,
1) it does say that assets related to the application (ie. need
preprocessing) can live in the myapp/app/assets directory
2) it does say that files which need no preprocessing can still live
in the public/ directory.

I can access files places in the myapp/app/assets directory with no
problems but
how do I access my files in public? For example, public/images/rails-
logo.png?

When I access that path via the webbrowser, I get an error, 'No route
matches [GET] "/public/images/rails-logo.png" '.


thank you

Gordon

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I looked at 'Upgrading from Old Versions of Rails' in
http://edgeguides.rubyonrails.org/asset_pipeline.html and that has now
fixed the problem whereby files in assets/ can now be accessed.

I followed the changes recommended and they worked.
Nevertheless, I could not see my custom javascript files in the html
when i view its source.

Thank you in advance for any help :)

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I created a new rails app in my /tmp directory.

I noticed that the Gemfile had something new relating to the asset
group.

The app I am working on was created with rails 3.0.x and hence, I made
a change to my Gemfile to use rails 3.1.0 and ran "bundle install" to
get rails 3.1.0 in.


------ This is what I saw in the Gemfile of a new 3.1.0 app I created
(start) --------
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', "~> 3.1.0"
gem 'uglifier'
end
------ This is what I saw in the Gemfile of a new 3.1.0 app I created
(end) --------


Seeing that and the fact that I use jquery and not coffee script or
sass (for css),
I altered my own Gemfile of the application which I am encountering a
problem with. See below.

------ This is what my current gemfile looks like (start) --------

source 'http://rubygems.org'

gem 'rails', '3.1.0'

gem 'devise'
gem 'factory_girl_rails' #, "~> 1.2"
gem 'paperclip'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'
gem 'jquery-rails', '>= 1.0.12'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
# gem 'sass-rails', " ~> 3.1.0"
# gem 'coffee-rails', "~> 3.1.0"
gem 'jquery-rails', '>= 1.0.12'
gem 'uglifier'
end

# clean up test db after each spec test run
gem "database_cleaner", "~> 0.6.7"

group :development, :test do
gem "rspec-rails", ">= 2.0.0"
gem "webrat", ">= 0.7.2"
end


------ This is what my current gemfile looks like (end) --------

I restarted my server and yet there's still no luck in accessing the
assets/javascripts/application.js file in my browser :(

Any ideas?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I had also clicked on 'application.js' in the line, '<script src="/
javascripts/application.js" type="text/javascript"></script>' in the
html file.

It looks like the files in app/assets cannot be accessed.

Here's what the source looks like. Observe the message, 'No route
matches [GET] &quot;/javascripts/application.js&quot;<'


---------- Extract of source starts -----------------------

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Action Controller: Exception caught</title>
<style>
body { background-color: #fff; color: #333; }

body, p, ol, ul, td {
font-family: helvetica, verdana, arial, sans-serif;
font-size: 13px;
line-height: 18px;
}

pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}

a { color: #000; }
a:visited { color: #666; }
a:hover { color: #fff; background-color:#000; }
</style>
</head>
<body>

<h1>Routing Error</h1>
<p><pre>No route matches [GET] &quot;/javascripts/
application.js&quot;</pre></p>

</body>
</html>

---------- Extract of source ends -----------------------

WIth the introduction of asset pipeline, should new routes be added to
enable files in the app/assets directory to be accessed?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hi, all,

Happy new year :)

Referring to http://guides.rubyonrails.org/asset_pipeline.html, it
seems that 'require_tree .' in myapp/app/assets/javascripts/
application.js will include all *.js files in the myapp/app/assets/
javascripts/.


I have a few other *.js files in this directory : parts.js, makes.js
and categories.js.


Here's an extract from the html file I am viewing:

--------------- Extract start -----------------------

<!DOCTYPE html>
<html>
<head>
<title>My App</title>

<script src="/javascripts/jquery.js" type="text/javascript"></
script>
<script src="/javascripts/application.js" type="text/javascript"></
script>
<script src="/javascripts/jquery.min.js" type="text/javascript"></
script>
<script src="/javascripts/jquery_ujs.js" type="text/javascript"></
script>
<!--, "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/
jquery.min.js" %>
- "jquery.js", "application.js", "jquery.min.js" , "jquery_ujs.js" -->

<!-- :defaults, "jquery.min.js" -->
<meta content="authenticity_token" name="csrf-param" />
<meta content="jfiFh0CGHgl5F6mX/dORtk1y6IMfnbCavwgx4bVYXbA="
name="csrf-token" />
</head>
<body>


--------------- Extract end -----------------------

My 'app/assets/javascripts/application.js' file is:


--------------- Extract start -----------------------
//= require jquery
//= require jquery_ujs
//= require_tree .

--------------- Extract end -----------------------


My question: I am using rails 3.1.0 and when I open up a page in the
webbrowser and view source, I am not seeing the 3 js files above
being included. Why are the 3 files not included? Is require_tree
broken?

Thank you :)

Gordon

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

1. The following javascript is being defined in myapp/public/
javascripts/application.js

jQuery(function($) {
// when the #search field changes
$("#category").change(function() {
// make a POST call and replace the content
$.post(<%= category_sub_categories_path %>, function(data) {
$("#results").html(data);
});
});
})

2. this javascript is being applied to the myapp/app/views/parts/
_form.html.erb partial template

My question is, if there is a rails variable, @categories in the
partial template, I need to pass the @categories.id value to the
javascript from there.
Would this work?


If somebody understands this and could comment, kindly share your
input.
Thank you

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On Sat, Dec 31, 2011 at 2:18 PM, Ralph Shnelvar <ralphs@dos32.com> wrote:

> jw_player needs to have videos somewhere in public.
>
> Can a link to cloud storage be placed there?  I am a complete noobie when it comes to cloud stuff and heroku.

This has nothing to do with Heroku specifically.

I've never used fw_player, but a quick glance at the docs shows it
(apparently) accepts a URL as a 'file' argument. Easiest way to find
out is try it.

Create an Amazon S3 account and upload a video file to it; put that
URL in a page on your development machine. When it works there,
it'll work anywhere :-)

--
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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I'm using simple-navigation but I want try other solutions, for
example with jquery.
What do you use for navigation menus with one or more levels?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

HAPPY NEW YEAR

from my I&iPhone

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Have time for a project?

from my I&iPhone

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hassan,

Saturday, December 31, 2011, 11:27:29 AM, you wrote:

HS> On Sat, Dec 31, 2011 at 10:18 AM, Ralph Shnelvar <ralphs@dos32.com> wrote:

>> Question:  Does that mean I can't add more gems to the gemfile when I do the next upload?

HS> No, each deployment reads the Gemfile and loads what it needs.

>> If I need to fix one .rb file (or whatever), do I have to upload the entire app?

HS> Sure, but it's just `git push heroku master` and wait a minute -- not a
HS> big deal. Though for quick deployments *anywhere* it's a good idea
HS> to separate out large assets (images, video, sound) to some cloud
HS> storage provider (e.g. AWS S3).

jw_player needs to have videos somewhere in public.

Can a link to cloud storage be placed there? I am a complete noobie when it comes to cloud stuff and heroku.

Ralph Shnelvar

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

After doing the pristine rebuild, I still received one persistent
gemspec error from dm-serializer. The problem was that gems couldn't
find the gem if I tried to rebuild it.

So I did this and it fixed it the last remaining error:

sudo gem install dm-serializer

- Bash

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

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On Sat, Dec 31, 2011 at 10:18 AM, Ralph Shnelvar <ralphs@dos32.com> wrote:

> Question:  Does that mean I can't add more gems to the gemfile when I do the next upload?

No, each deployment reads the Gemfile and loads what it needs.

> If I need to fix one .rb file (or whatever), do I have to upload the entire app?

Sure, but it's just `git push heroku master` and wait a minute -- not a
big deal. Though for quick deployments *anywhere* it's a good idea
to separate out large assets (images, video, sound) to some cloud
storage provider (e.g. AWS S3).

> I have sooo many questions.
>
> For instance, will Heroku, for a fee, be my ISP for the app?  That is, will they host my app and my url: www.ultradedup.com?

That's exactly their business, yes :-)

--
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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hassan,

>> Am I even able to do a bundle whatever on the server they provide?

HS> You don't need to; Heroku uses your Gemfile to make the required
HS> gems available to the app at deployment.

Dear God!

One sentence and "everything" snaps into focus.

Thank you!


Question: Does that mean I can't add more gems to the gemfile when I do the next upload?

If I need to fix one .rb file (or whatever), do I have to upload the entire app?


I have sooo many questions.

For instance, will Heroku, for a fee, be my ISP for the app? That is, will they host my app and my url: www.ultradedup.com?

Ralph

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I've spent a lot of time trying to create a new model and, at the same
time, setting an attribute of the join model.
I have:
Company
has_many :managements
has_many :managers, :through => :managements

Manager
has_many :managements
has_many :companies, :through => :managements

Then I try to create a new manager with a associated company like this:

- args = @company.nil? ? [@manager] : [[@company, @manager], {:remote => true}]
= simple_form_for *args do |f|

= field_set_tag t('manager.manager') do
= f.input :name
= f.input :surname
= f.input :fiscal_code
= f.input :city
= f.input :zip_code
= f.input :address
= f.input :street_number
= f.input :tel
= f.input :email
= f.simple_fields_for :managements do |p|
= p.input :role


I don't see the field role in the form and I don't know how to set
role when the Management model is created.
How to do this?
Please an advice.
Thanks.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Friday, December 30, 2011, 7:09:08 PM, you wrote:

CW> On Fri, 2011-12-30 at 12:21 -0700, Ralph Shnelvar wrote:
>> I have a library conflict between jQuery.js & accordion.js
>>
>> The first line of accordion.js is
>>
>> $(document).ready(function() {
>>
>>
>> Firebug displays
>> $(document).ready is not a function
>>
>>
>> I have read http://docs.jquery.com/Using_jQuery_with_Other_Libraries. This link is an explanation of how to resolve the conflict.
>>
>>
>>
>> To that end I have in a partial haml file
>>
>> (function($) {
>> = javascript_include_tag 'accordion.js'
>> })(jQuery);
>>
>>
>> The rendered output is
>> (function($) {
>> <script src="/assets/accordion.js?body=1" type="text/javascript"></script>
>> })(jQuery);
>>
>>
>>
>> but I am still getting the
>> $(document).ready is not a function
>> error message.
>>
>>
>>
>> Is what I am trying to do even legal?
CW> ----
CW> sounds as if you tinkered with application.js or removed the reference
CW> to it completely and thus jquery isn't loaded at all.

Craig:

I modified accordion.js by wrapping it in
(function($) { ... })(jQuery);

And everything works.


If I don't do it, the text
(function($) {
})(jQuery);
ends up being displayed on the webpage as the 1st two lines. I didn't see it before.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On 31/12/11 15:15, "Greg Akins" <angrygreg@gmail.com> wrote:

> On Fri, Dec 30, 2011 at 9:06 PM, Jason <jasonwhitestl@gmail.com> wrote:
>> My recommendation is to use rails ready, I used it the other day when
>> setting up my MacBook and was really excited with the results.
>>
>> https://github.com/joshfng/railsready
>
> Does railsready use RVM? I've followed the RVM instructions on a
> couple machines and never had any problems installing RoR on a Mac.

From a quick look at the link, it also gives you Homebrew (not a good idea
if have MacPorts/fink installed) & it is recommended to run it on a fresh
install of the OS. There is an rvm option.

Bit over the top for my liking...

Cheers,

Phil...

--
Nothing to see here... move along, move along

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On Sat, Dec 31, 2011 at 12:54 AM, K.M. <anexiole@gmail.com> wrote:
> hi guys,
>  I am now rewriting an existing app (rails  2.3.8) with rails 3.1.x.
>
> As observe_field() is no longer the way to go with rails 3 when ajax
> is used, I am trying to rewrite a piece of functionality for when a
> select box (drop down) with a div id of 'category'  is clicked
> (onChange),
> -a call is made to the sub_categories controller with the category ID
> (from the selected option in the category select box)
> -the sub categories belonging to the selected category ID will be
> returned and a another select box is to be generated in the div with
> id of 'sub_category'.
>
>
> I'm looking at http://www.simonecarletti.com/blog/2010/06/unobtrusive-javascript-in-rails-3/
> and I have a question now.
>
>  How do I go about passing a variable value to the javascript that
> performs the asynchronous call?
>
> For example, i have :
>
> // Append the function to the "document ready" chain
> jQuery(function($) {
>  // when the #search field changes
>  $("#category").change(function() {
>    // make a POST call and replace the content
>    $.post(<%= category_sub_categories_path %>, function(data) {
>      $("#results").html(data);
>    });
>  });
> })
>
>
>
> -how do I pass the category id (which is a form value) to the
> category_sub_categories_path??
> -would the category_id value be valid in the jQuery call?
>

This has nothing to do with Rails, this is a strictly jQuery question.
Take a look at the $.post documentation[1]

Cheers.
[1]http://api.jquery.com/jQuery.post/

--
Leonardo Mateo.
There's no place like ~

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On Sat, Dec 31, 2011 at 5:31 AM, Ralph Shnelvar <ralphs@dos32.com> wrote:

> I'm trying to deploy to Heroku and I am very unfamiliar with procedures for it.

Have you read their instructions? It's really pretty simple.

> Am I even able to do a bundle whatever on the server they provide?

You don't need to; Heroku uses your Gemfile to make the required
gems available to the app at deployment.

--
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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On Fri, Dec 30, 2011 at 9:06 PM, Jason <jasonwhitestl@gmail.com> wrote:
> My recommendation is to use rails ready, I used it the other day when
> setting up my MacBook and was really excited with the results.
>
> https://github.com/joshfng/railsready

Does railsready use RVM? I've followed the RVM instructions on a
couple machines and never had any problems installing RoR on a Mac.

--
Greg Akins
http://twitter.com/akinsgre

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hmmm
Thx... I will take a look in this whenever. It's seems easy to use. :D

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Saturday, December 31, 2011, 3:24:37 AM, you wrote:


I am so lost.


I'm trying to deploy to Heroku and I am very unfamiliar with procedures for it.


Am I even able to do a bundle whatever on the server they provide?





The machine where you run bundle --deployment, is that a development machine or a deployment machine?? because on http://gembundler.com/ it states



Deploying Your Application 

On production servers, you can enable deployment mode: 

$ bundle install --deployment

Do not use this flag on development machines. The --deployment flag turns on defaults that are appropriate for a deployment environment. Gems are installed to vendor/bundle and the Gemfile.lock must be checked in and up to date before Bundler is run. 



This is how i do it..


After i create the rails app i run


bundle install


then run,


bundle package


which vendors the gems. Now anytime i need to add any new gem I add it to the Gemfile and run 'bundle install' which installs the gem and vendors it too.


At the top of my 'deploy.rb' file i have require "bundler/capistrano" which handles deployment automatically.


This just works for me.


Gautam Pai



On Sat, Dec 31, 2011 at 6:57 AM, Ralph Shnelvar <ralphs@dos32.com> wrote:


So O have a working 3.1.2 application.  I had done a

 bundle install --deployment



Now I want to add nokogiri so I added

 gem 'nokogiri'

to the Gemfile




I then did


- - - -


c:\RailsInstaller\Sites\ultradedup002> bundle install --deployment

You are trying to install in deployment mode after changing

your Gemfile. Run `bundle install` elsewhere and add the

updated Gemfile.lock to version control.


You have added to the Gemfile:

* nokogiri


c:\RailsInstaller\Sites\ultradedup002> bundle install

You are trying to install in deployment mode after changing

your Gemfile. Run `bundle install` elsewhere and add the

updated Gemfile.lock to version control.


If this is a development machine, remove the Gemfile freeze

by running `bundle install --no-deployment`.


You have added to the Gemfile:

* nokogiri


c:\RailsInstaller\Sites\ultradedup002> bundle install --no-deployment

.

.

.


c:\RailsInstaller\Sites\ultradedup002> bundle install --deployment


- - - -



What's going on?  Why do I need to go through these contortions?


Ralph Shnelvar


--

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.

To post to this group, send email to rubyonrails-talk@googlegroups.com.

To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.




-- 

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.

To post to this group, send email to rubyonrails-talk@googlegroups.com.

To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.





-- 

Best regards,

 Ralph                            mailto:ralphs@dos32.com

Ruby on Rails

On Thu, Dec 29, 2011 at 8:24 AM, sethgitner <sgitner@gmail.com> wrote:
I am having issues loading imagemagick and rmagick on webfaction.

I have installed a rails app called balder that organizes images.

my main problem is that i can't seem to upoload the image sthrough balder.

balder uses imagemagick and rmagick

Well, checking deeper, it seems to use mini_magick by default
and only optionally uses rmagick. 


when i use the console and do this:

irb(main):003:0> require 'RMagick'
=> nil

I don't think rmagick is working -- anyone have any ideas?

This page:


says:

- ImageMagicK. Carrierwave can use either RMagicK or MiniMagicK (default). To change resize option the correct gem must be used (specified in Gemfile) and change included setting for Carrierwave in file_uploader.rb
Can be installed from: http://www.imagemagick.org

Looking into that file:

  # Include RMagick or ImageScience support
  #     include CarrierWave::RMagick
  #     include CarrierWave::ImageScience
       include CarrierWave::MiniMagick

Did you change these default settings?

Looking into the Gemfile:


...
# -- Photo resizing
# MiniMagick
gem "mini_magick"

# ImageMagick:
#gem "rmagick", :require => 'RMagick'

# FreeImage:
#gem "RubyInline"
#gem "image_science", :git => 'git://github.com/perezd/image_science.git'

So, probably, if you want to activate rmagick for CarrierWave, you should uncomment
the line with "rmagick" and rerun `bundle install` after that.

But, I would first check why the upload functionality does not work with the
default mini_magick that _is_ most probably installed.

But then again ... this file
resources/DummyHTML/css/joshuaclayton-blueprint-css-05312a805eca539ab85e435cfd94bdedfd12ab2e/lib/blueprint/grid_builder.rb
also tries to require 'rmagick' and install the gem 'rmagick'...

HTH,

Peter


--
Peter Vandenabeele
http://twitter.com/peter_v

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hi all,

Wish all of you a Happy and Prosperous New year njoy the day and
keep njoying for ever...


Here is my Query regarding to my project which I find it difficult I
used Fb Graph API also please help me out for the following:

I am using rails and I need to fetch all user videos and user friend's
videos from facebook and store it in our database(In simple words I
have to fetch all videos from user's news feed page in facebook).

Video's like
1)User and user friend's liked videos,
2)User and user friend's shared videos,
3)User and user friend's tagged videos,
4)User and user friend's commented videos,
5)User and user friend's uploaded videos, etc

So Is there any easy method to retrive all these videos at same
time??

Thanks to Rails talk google group

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

+1 to "whenever" gem for the exact reasons benjamin points out.

Gautam Pai

On Sat, Dec 31, 2011 at 12:45 AM, Benjamin Iandavid Rodriguez <ian.rgz@gmail.com> wrote:
You also might want to have a look at the Whenever gem it provides neat syntax all done with ruby and integrates well with capistrano.

https://github.com/javan/whenever

Hope this helps!


2011/12/30 Peter Hickman <peterhickman386@googlemail.com>
That way the crons can also be maintained when you use capistrano and
they will be deployed to new machines if needed. It makes a great deal
of sense to bundle the application specific crons with he application
itself.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

The machine where you run bundle --deployment, is that a development machine or a deployment machine?? because on http://gembundler.com/ it states


Deploying Your Application

On production servers, you can enable deployment mode:
$ bundle install --deployment
Do not use this flag on development machines. The --deployment flag turns on defaults that are appropriate for a deployment environment. Gems are installed to vendor/bundle and the Gemfile.lock must be checked in and up to date before Bundler is run.


This is how i do it..

After i create the rails app i run

bundle install

then run,

bundle package

which vendors the gems. Now anytime i need to add any new gem I add it to the Gemfile and run 'bundle install' which installs the gem and vendors it too.

At the top of my 'deploy.rb' file i have require "bundler/capistrano" which handles deployment automatically.

This just works for me.

Gautam Pai

On Sat, Dec 31, 2011 at 6:57 AM, Ralph Shnelvar <ralphs@dos32.com> wrote:
So O have a working 3.1.2 application.  I had done a
 bundle install --deployment


Now I want to add nokogiri so I added
 gem 'nokogiri'
to the Gemfile



I then did

- - - -

c:\RailsInstaller\Sites\ultradedup002> bundle install --deployment
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

You have added to the Gemfile:
* nokogiri

c:\RailsInstaller\Sites\ultradedup002> bundle install
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

If this is a development machine, remove the Gemfile freeze
by running `bundle install --no-deployment`.

You have added to the Gemfile:
* nokogiri

c:\RailsInstaller\Sites\ultradedup002> bundle install --no-deployment
.
.
.

c:\RailsInstaller\Sites\ultradedup002> bundle install --deployment

- - - -


What's going on?  Why do I need to go through these contortions?

Ralph Shnelvar

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

This playing a video is a new one for me so i am learning it. if u don't know how play a video it does not mean you don't know ROR . New things has to learned only by researching and in that process only i posted it. 

On Thu, Dec 29, 2011 at 1:46 PM, Ben Eggett <beneggett@gmail.com> wrote:
Sorry to be harsh, but if you don't know how to code to play videos,
you probably ought to forget about RoR for a bit and start with
learning front-end coding and playback mechanisms. Once you have some
solid tools built up, you can then bring it back into RoR and use Ruby
to draw your video players and source files dynamically.

There are plenty of good places to start, depending on your needs:
 http://camendesign.com/code/video_for_everybody
http://sandbox.thewikies.com/vfe-generator/
http://flowplayer.org
http://videojs.com

or simply youtube.com - embedding videos.

You need to know the difference between front-end and back-end tools
(client side and server side). Realizing that RoR will ultimately
deliver front-end code to the user in some form or another



On Dec 28, 3:55 am, honey ruby <emailtohoneyr...@gmail.com> wrote:
> hey everyone i want to add a video and play it using ruby on rails .
> how can i do it. can anyone help me plzz..
>
> Thanks in advance

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails Friday, December 30, 2011

hi guys,
I am now rewriting an existing app (rails 2.3.8) with rails 3.1.x.

As observe_field() is no longer the way to go with rails 3 when ajax
is used, I am trying to rewrite a piece of functionality for when a
select box (drop down) with a div id of 'category' is clicked
(onChange),
-a call is made to the sub_categories controller with the category ID
(from the selected option in the category select box)
-the sub categories belonging to the selected category ID will be
returned and a another select box is to be generated in the div with
id of 'sub_category'.


I'm looking at http://www.simonecarletti.com/blog/2010/06/unobtrusive-javascript-in-rails-3/
and I have a question now.

How do I go about passing a variable value to the javascript that
performs the asynchronous call?

For example, i have :

// Append the function to the "document ready" chain
jQuery(function($) {
// when the #search field changes
$("#category").change(function() {
// make a POST call and replace the content
$.post(<%= category_sub_categories_path %>, function(data) {
$("#results").html(data);
});
});
})

-how do I pass the category id (which is a form value) to the
category_sub_categories_path??
-would the category_id value be valid in the jQuery call?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Check out the active merchant gem it's the best solution out there for integrating check out process into your rails app.

https://github.com/Shopify/active_merchant

2011/12/30 Ashok K. <lists@ruby-forum.com>
i am the new from rails please tell the below solution
 how to get the amount from paypal and that amount is added to the admin
in rails 3

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

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On Fri, 2011-12-30 at 12:21 -0700, Ralph Shnelvar wrote:
> I have a library conflict between jQuery.js & accordion.js
>
> The first line of accordion.js is
>
> $(document).ready(function() {
>
>
> Firebug displays
> $(document).ready is not a function
>
>
> I have read http://docs.jquery.com/Using_jQuery_with_Other_Libraries. This link is an explanation of how to resolve the conflict.
>
>
>
> To that end I have in a partial haml file
>
> (function($) {
> = javascript_include_tag 'accordion.js'
> })(jQuery);
>
>
> The rendered output is
> (function($) {
> <script src="/assets/accordion.js?body=1" type="text/javascript"></script>
> })(jQuery);
>
>
>
> but I am still getting the
> $(document).ready is not a function
> error message.
>
>
>
> Is what I am trying to do even legal?
----
sounds as if you tinkered with application.js or removed the reference
to it completely and thus jquery isn't loaded at all.

Craig


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

My recommendation is to use rails ready, I used it the other day when setting up my MacBook and was really excited with the results.


On Dec 28, 2011, at 10:33 AM, Francesca Krihely <francesca@10gen.com> wrote:

Try using Sudo

Also, Xcode could be out of date re: this problem (http://railsforum.com/viewtopic.php?id=22116



On Wed, Dec 28, 2011 at 11:22 AM, Krishna P. <lists@ruby-forum.com> wrote:
Hello all,
I am stuck and I need your help. I tried to install rails and got the
mkmf error. I installed ruby1.8-dev and I am still getting the same
error.

Rails install error:
--------------------
root@localhost:~# gem install rails
Building native extensions.  This could take a while...
ERROR:  Error installing rails:
       ERROR: Failed to build gem native extension.

/usr/bin/ruby1.9.1 extconf.rb
<internal:lib/rubygems/custom_require>:29:in `require': no such file to
load -- mkmf (LoadError)
       from <internal:lib/rubygems/custom_require>:29:in `require'
       from extconf.rb:1:in `<main>'


Gem files will remain installed in /var/lib/gems/1.9.1/gems/json-1.6.4
for inspection.
Results logged to
/var/lib/gems/1.9.1/gems/json-1.6.4/ext/json/ext/parser/gem_make.out



Proof of ruby1.8-dev installation
----------------------------------
root@localhost:~# apt-get install ruby1.8-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
ruby1.8-dev is already the newest version.
The following packages were automatically installed and are no longer
required:
 libactionmailer-ruby1.8 linux-headers-2.6.35-25-server
libcmdparse2-ruby1.8
 libtext-format-ruby1.8 libtmail-ruby1.8 libmocha-ruby1.8
 libactivesupport-ruby1.8 libredcloth-ruby1.8 libjs-prototype
 libmemcache-client-ruby1.8 linux-headers-2.6.35-22-server
 libactionpack-ruby1.8 libactiveresource-ruby1.8 libsqlite3-ruby1.8
 liblog4r-ruby1.8 libbuilder-ruby1.8 libncurses-ruby1.8
 linux-headers-2.6.35-23-server librack-ruby libtzinfo-ruby1.8
 linux-headers-2.6.35-22 linux-headers-2.6.35-23
linux-headers-2.6.35-24
 linux-headers-2.6.35-25 linux-headers-2.6.35-27 libdaemons-ruby1.8
 linux-headers-2.6.35-27-server libactiverecord-ruby1.8 librack-ruby1.8
 wwwconfig-common rubygems1.8 linux-headers-2.6.35-24-server
libjs-jquery
 libi18n-ruby1.8 javascript-common
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 113 not upgraded.

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

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.




--
Francesca Krihely | Community Marketing Manager | 10gen
Skype: FrancescaMongoDB

Mongo Boulder is happening February 1st! Join us or propose a talk
We're hiring! Come build great things with us 10gen.com/careers

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Using deployment mode with bundler requires an up-to-date Gemfile.lock.

See here:
http://gembundler.com/man/bundle-install.1.html#DEPLOYMENT-MODE

On Fri, Dec 30, 2011 at 8:27 PM, Ralph Shnelvar <ralphs@dos32.com> wrote:
> So O have a working 3.1.2 application.  I had done a
>  bundle install --deployment
>
>
> Now I want to add nokogiri so I added
>  gem 'nokogiri'
> to the Gemfile
>
>
>
> I then did
>
> - - - -
>
> c:\RailsInstaller\Sites\ultradedup002> bundle install --deployment
> You are trying to install in deployment mode after changing
> your Gemfile. Run `bundle install` elsewhere and add the
> updated Gemfile.lock to version control.
>
> You have added to the Gemfile:
> * nokogiri
>
> c:\RailsInstaller\Sites\ultradedup002> bundle install
> You are trying to install in deployment mode after changing
> your Gemfile. Run `bundle install` elsewhere and add the
> updated Gemfile.lock to version control.
>
> If this is a development machine, remove the Gemfile freeze
> by running `bundle install --no-deployment`.
>
> You have added to the Gemfile:
> * nokogiri
>
> c:\RailsInstaller\Sites\ultradedup002> bundle install --no-deployment
> .
> .
> .
>
> c:\RailsInstaller\Sites\ultradedup002> bundle install --deployment
>
> - - - -
>
>
> What's going on?  Why do I need to go through these contortions?
>
> Ralph Shnelvar
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

So O have a working 3.1.2 application. I had done a
bundle install --deployment


Now I want to add nokogiri so I added
gem 'nokogiri'
to the Gemfile

I then did

- - - -

c:\RailsInstaller\Sites\ultradedup002> bundle install --deployment
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

You have added to the Gemfile:
* nokogiri

c:\RailsInstaller\Sites\ultradedup002> bundle install
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

If this is a development machine, remove the Gemfile freeze
by running `bundle install --no-deployment`.

You have added to the Gemfile:
* nokogiri

c:\RailsInstaller\Sites\ultradedup002> bundle install --no-deployment
.
.
.

c:\RailsInstaller\Sites\ultradedup002> bundle install --deployment

- - - -


What's going on? Why do I need to go through these contortions?

Ralph Shnelvar

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

The error message refer version 1.9.1

I suggest install version 1.9.2 using rvm.

Raul

El 28/12/2011 02:33 p.m., Francesca Krihely escribió:
> Try using Sudo
>
> Also, Xcode could be out of date re: this problem
> (http://railsforum.com/viewtopic.php?id=22116)
>
>
>
> On Wed, Dec 28, 2011 at 11:22 AM, Krishna P. <lists@ruby-forum.com
> <mailto:lists@ruby-forum.com>> wrote:
>
> Hello all,
> I am stuck and I need your help. I tried to install rails and got the
> mkmf error. I installed ruby1.8-dev and I am still getting the same
> error.
>
> Rails install error:
> --------------------
> root@localhost:~# gem install rails
> Building native extensions. This could take a while...
> ERROR: Error installing rails:
> ERROR: Failed to build gem native extension.
>
> /usr/bin/ruby1.9.1 extconf.rb
> <internal:lib/rubygems/custom_require>:29:in `require': no such file to
> load -- mkmf (LoadError)
> from <internal:lib/rubygems/custom_require>:29:in `require'
> from extconf.rb:1:in `<main>'
>
>
> Gem files will remain installed in /var/lib/gems/1.9.1/gems/json-1.6.4
> for inspection.
> Results logged to
> /var/lib/gems/1.9.1/gems/json-1.6.4/ext/json/ext/parser/gem_make.out
>
>
>
> Proof of ruby1.8-dev installation
> ----------------------------------
> root@localhost:~# apt-get install ruby1.8-dev
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> ruby1.8-dev is already the newest version.
> The following packages were automatically installed and are no longer
> required:
> libactionmailer-ruby1.8 linux-headers-2.6.35-25-server
> libcmdparse2-ruby1.8
> libtext-format-ruby1.8 libtmail-ruby1.8 libmocha-ruby1.8
> libactivesupport-ruby1.8 libredcloth-ruby1.8 libjs-prototype
> libmemcache-client-ruby1.8 linux-headers-2.6.35-22-server
> libactionpack-ruby1.8 libactiveresource-ruby1.8 libsqlite3-ruby1.8
> liblog4r-ruby1.8 libbuilder-ruby1.8 libncurses-ruby1.8
> linux-headers-2.6.35-23-server librack-ruby libtzinfo-ruby1.8
> linux-headers-2.6.35-22 linux-headers-2.6.35-23
> linux-headers-2.6.35-24
> linux-headers-2.6.35-25 linux-headers-2.6.35-27 libdaemons-ruby1.8
> linux-headers-2.6.35-27-server libactiverecord-ruby1.8 librack-ruby1.8
> wwwconfig-common rubygems1.8 linux-headers-2.6.35-24-server
> libjs-jquery
> libi18n-ruby1.8 javascript-common
> Use 'apt-get autoremove' to remove them.
> 0 upgraded, 0 newly installed, 0 to remove and 113 not upgraded.
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to
> rubyonrails-talk@googlegroups.com
> <mailto:rubyonrails-talk@googlegroups.com>.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscribe@googlegroups.com
> <mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com>.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>
>
>
> --
> *Francesca Krihely | **Community Marketing Manager | **10gen*
> *@francescapasha <http://twitter.com/francescapasha> | **@mongoDB
> <http://twitter.com/mongoDB>*
> *Skype: FrancescaMongoDB*
> *
> *
> /Mongo Boulder is happening February 1st! Join us
> <http://www.10gen.com/events/mongo-boulder> or propose a talk
> <http://www.10gen.com/talk-proposal>/
> /We're hiring! Come build great things with us 10gen.com/careers
> <http://10gen.com/careers>/
>
> --
> You received this message because you are subscribed to the Google
> Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.

--
Raul Lopez

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Put `= javascript_include_tag 'accordion.js'` outside your jquery listeners:

_my_partial.haml
= javascript_include_tag 'accordion'
:javascript
(function($) {
// jquery listeners here
})(jQuery);

On Fri, Dec 30, 2011 at 2:21 PM, Ralph Shnelvar <ralphs@dos32.com> wrote:
> I have a library conflict between jQuery.js & accordion.js
>
> The first line of accordion.js is
>
>  $(document).ready(function() {
>
>
> Firebug displays
>  $(document).ready is not a function
>
>
> I have read http://docs.jquery.com/Using_jQuery_with_Other_Libraries.  This link is an explanation of how to resolve the conflict.
>
>
>
> To that end I have in a partial haml file
>
> (function($) {
> = javascript_include_tag 'accordion.js'
> })(jQuery);
>
>
> The rendered output is
>  (function($) {
>  <script src="/assets/accordion.js?body=1" type="text/javascript"></script>
>  })(jQuery);
>
>
>
> but I am still getting the
>  $(document).ready is not a function
> error message.
>
>
>
> Is what I am trying to do even legal?
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On Fri, Dec 30, 2011 at 11:46 AM, Peter De Berdt
<peter.de.berdt@pandora.be> wrote:

>> I would also advise planning ahead to remove this "feature" when your
>> client begs you to, since the users will all hate it.
>
> So true. We were asked this question for some freelance work a few years
> back, in fact, they insisted on having that "feature" for security reasons.
> It took them exactly one week to beg us to take it away again. 5 minutes
> pass so quickly: you have a phone call, you get a coffee and bump into a
> colleague, …

But the "how to" remains a valid question, regardless of whether it's
5 minutes, 30 minutes or 24 hours :-)

--
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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On 30 Dec 2011, at 19:54, Robert Walker wrote:

>>> Devise will expire session in the time that you put in
>>> 'config/initializers/devise.rb' with
>>>
>>> config.timeout_in = 5.minutes
>>>
>>> but this won't redirect your app automatically to the login page,
>>> so,
>>> you would need some javascript function to solve this.
>>
>> Alternatively, just include a meta-refresh tag in every page
>> pointing to
>> your login page, with the appropriate timeout as the refresh
>> interval.
>
> I would also advise planning ahead to remove this "feature" when your
> client begs you to, since the users will all hate it.

So true. We were asked this question for some freelance work a few
years back, in fact, they insisted on having that "feature" for
security reasons. It took them exactly one week to beg us to take it
away again. 5 minutes pass so quickly: you have a phone call, you get
a coffee and bump into a colleague, …


Best regards

Peter De Berdt

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I have a library conflict between jQuery.js & accordion.js

The first line of accordion.js is

$(document).ready(function() {


Firebug displays
$(document).ready is not a function


I have read http://docs.jquery.com/Using_jQuery_with_Other_Libraries. This link is an explanation of how to resolve the conflict.

To that end I have in a partial haml file

(function($) {
= javascript_include_tag 'accordion.js'
})(jQuery);


The rendered output is
(function($) {
<script src="/assets/accordion.js?body=1" type="text/javascript"></script>
})(jQuery);

but I am still getting the
$(document).ready is not a function
error message.

Is what I am trying to do even legal?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

You also might want to have a look at the Whenever gem it provides neat syntax all done with ruby and integrates well with capistrano.

https://github.com/javan/whenever

Hope this helps!

2011/12/30 Peter Hickman <peterhickman386@googlemail.com>
That way the crons can also be maintained when you use capistrano and
they will be deployed to new machines if needed. It makes a great deal
of sense to bundle the application specific crons with he application
itself.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On Dec 30, 2011, at 11:46 AM, Walter Lee Davis wrote:

>
> On Dec 30, 2011, at 12:37 PM, Craig White wrote:
>
>>
>> On Dec 30, 2011, at 9:58 AM, Walter Lee Davis wrote:
>>
>>>
>>> On Dec 30, 2011, at 11:32 AM, Craig White wrote:
>>>
>>>> Previous versions of Rails, I could just...
>>>>
>>>> (app/helpers/application_helper.rb)
>>>> def set_focus_to_id(id)
>>>> javascript_tag("$('#{id}').focus()");
>>>> end
>>>>
>>>> then in any view, do something like
>>>> <%= set_focus_to_id 'user_uid' %>
>>>>
>>>> but this doesn't work in Rails 3.1.x
>>>>
>>>> What is the new preferred method for doing this?
>>>
>>> View source (in a browser) and see if you have the prototype.js library loaded. focus() is a Prototype method (unless I'm wrong and it's in jQuery as well) and without the library it won't work.
>>>
>>> 3.1 switched to jQuery, which annoys me, but there is a gem you can add to put things right again.
>>>
>>> One other thing to look at -- is your call to set_focus_to_id appearing (in source) below the element it refers to? If it isn't, then you have to wrap your call in an observer callback, so that you are sure that the DOM is ready and knows about the element you're trying to modify.
>>>
>>> If your code is at the bottom of your view, then you should be fine, but if it's above the referenced element, or if it's in a content_for :head block, then you have to do something like this:
>>>
>>> #prototype-flavored javascript
>>> document.observe('dom:loaded', function(){
>>> //your code here
>>> });
>> ----
>> duh... prototype - I don't think it's useful to load both prototype and jquery as I'm already using a bunch of query.
>>
>> I'll see if I can figure out how to change that to a jquery friendly method.
>
> $(document).ready(function() {
> $('#yourElement').focus();
> });
>
> It's just a matter of making it a CSS selector, rather than an ID selector. In Prototype, you would use the $$() method with a CSS selector, and that method always returns an array, so you would have to write it as $$('#yourElement').invoke('focus');. jQuery returns either a single element or an array, which is one of the many ways it is icky.
----
well I was trying to implement a generic method of passing a specific ID variable and having the method in the application_helper.rb so I could selectively assert which field by ID but I ended up just putting the following inside the final </html> tag in my layout...

<script>$("input:text:visible:first").focus();</script>

Which just puts the focus on the first field... not the same but probably good enough for my purposes.

Thanks

Craig

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hassan Schroeder wrote in post #1038883:
> On Fri, Dec 30, 2011 at 7:40 AM, Csar <cesare.diaz@gmail.com> wrote:
>
>> Devise will expire session in the time that you put in
>> 'config/initializers/devise.rb' with
>>
>> config.timeout_in = 5.minutes
>>
>> but this won't redirect your app automatically to the login page, so,
>> you would need some javascript function to solve this.
>
> Alternatively, just include a meta-refresh tag in every page pointing to
> your login page, with the appropriate timeout as the refresh interval.

I would also advise planning ahead to remove this "feature" when your
client begs you to, since the users will all hate it.

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

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On Dec 30, 2011, at 12:37 PM, Craig White wrote:

>
> On Dec 30, 2011, at 9:58 AM, Walter Lee Davis wrote:
>
>>
>> On Dec 30, 2011, at 11:32 AM, Craig White wrote:
>>
>>> Previous versions of Rails, I could just...
>>>
>>> (app/helpers/application_helper.rb)
>>> def set_focus_to_id(id)
>>> javascript_tag("$('#{id}').focus()");
>>> end
>>>
>>> then in any view, do something like
>>> <%= set_focus_to_id 'user_uid' %>
>>>
>>> but this doesn't work in Rails 3.1.x
>>>
>>> What is the new preferred method for doing this?
>>
>> View source (in a browser) and see if you have the prototype.js library loaded. focus() is a Prototype method (unless I'm wrong and it's in jQuery as well) and without the library it won't work.
>>
>> 3.1 switched to jQuery, which annoys me, but there is a gem you can add to put things right again.
>>
>> One other thing to look at -- is your call to set_focus_to_id appearing (in source) below the element it refers to? If it isn't, then you have to wrap your call in an observer callback, so that you are sure that the DOM is ready and knows about the element you're trying to modify.
>>
>> If your code is at the bottom of your view, then you should be fine, but if it's above the referenced element, or if it's in a content_for :head block, then you have to do something like this:
>>
>> #prototype-flavored javascript
>> document.observe('dom:loaded', function(){
>> //your code here
>> });
> ----
> duh... prototype - I don't think it's useful to load both prototype and jquery as I'm already using a bunch of query.
>
> I'll see if I can figure out how to change that to a jquery friendly method.

$(document).ready(function() {
$('#yourElement').focus();
});

It's just a matter of making it a CSS selector, rather than an ID selector. In Prototype, you would use the $$() method with a CSS selector, and that method always returns an array, so you would have to write it as $$('#yourElement').invoke('focus');. jQuery returns either a single element or an array, which is one of the many ways it is icky.

Walter

>
> Thanks
>
> Craig
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Alexey Muranov wrote in post #1038755:
> I like the idea.
>
> By the way, the issues are not on Lighthouse anymore but on GitHub:
> https://github.com/rails/rails/issues

Right you are. So, feeling a little like David facing off against
Goliath, I've submitted a ticket:

https://github.com/rails/rails/issues/4234

I hope they go gentle on me!

- ff

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

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On Dec 30, 2011, at 9:58 AM, Walter Lee Davis wrote:

>
> On Dec 30, 2011, at 11:32 AM, Craig White wrote:
>
>> Previous versions of Rails, I could just...
>>
>> (app/helpers/application_helper.rb)
>> def set_focus_to_id(id)
>> javascript_tag("$('#{id}').focus()");
>> end
>>
>> then in any view, do something like
>> <%= set_focus_to_id 'user_uid' %>
>>
>> but this doesn't work in Rails 3.1.x
>>
>> What is the new preferred method for doing this?
>
> View source (in a browser) and see if you have the prototype.js library loaded. focus() is a Prototype method (unless I'm wrong and it's in jQuery as well) and without the library it won't work.
>
> 3.1 switched to jQuery, which annoys me, but there is a gem you can add to put things right again.
>
> One other thing to look at -- is your call to set_focus_to_id appearing (in source) below the element it refers to? If it isn't, then you have to wrap your call in an observer callback, so that you are sure that the DOM is ready and knows about the element you're trying to modify.
>
> If your code is at the bottom of your view, then you should be fine, but if it's above the referenced element, or if it's in a content_for :head block, then you have to do something like this:
>
> #prototype-flavored javascript
> document.observe('dom:loaded', function(){
> //your code here
> });
----
duh... prototype - I don't think it's useful to load both prototype and jquery as I'm already using a bunch of query.

I'll see if I can figure out how to change that to a jquery friendly method.

Thanks

Craig

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On Dec 30, 2011, at 11:32 AM, Craig White wrote:

> Previous versions of Rails, I could just...
>
> (app/helpers/application_helper.rb)
> def set_focus_to_id(id)
> javascript_tag("$('#{id}').focus()");
> end
>
> then in any view, do something like
> <%= set_focus_to_id 'user_uid' %>
>
> but this doesn't work in Rails 3.1.x
>
> What is the new preferred method for doing this?

View source (in a browser) and see if you have the prototype.js library loaded. focus() is a Prototype method (unless I'm wrong and it's in jQuery as well) and without the library it won't work.

3.1 switched to jQuery, which annoys me, but there is a gem you can add to put things right again.

One other thing to look at -- is your call to set_focus_to_id appearing (in source) below the element it refers to? If it isn't, then you have to wrap your call in an observer callback, so that you are sure that the DOM is ready and knows about the element you're trying to modify.

If your code is at the bottom of your view, then you should be fine, but if it's above the referenced element, or if it's in a content_for :head block, then you have to do something like this:

#prototype-flavored javascript
document.observe('dom:loaded', function(){
//your code here
});

Walter


>
> --
> Craig White ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ craig.white@ttiltd.com
> 1.800.869.6908 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ www.ttiassessments.com
>
> Need help communicating between generations at work to achieve your desired success? Let us help!
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.