Ruby on Rails Friday, August 31, 2012

Hey, you got to set @cart in your controller. That's what the error is saying: nil.paypal_url.

2012/9/1 Khan <emailtosameenakhan@gmail.com>
Hi all i am following this like for basic paypal http://railscasts.com/episodes/141-paypal-basics
and i got this error


View:

<%= link_to "Checkout", @cart.paypal_url() %>

undefined method `paypal_url' for nil:NilClass
despite i have this code in my model called Card

Cart Model:

class Cart < ActiveRecord::Base





def paypal_url(return_url)
values = {
:business => '',
:cmd => '_cart',
:upload => 1,
:return => return_url,
:invoice => id
}
line_items.each_with_index do |item, index|
values.merge!({
"amount_#{index+1}" => 500,
"item_name_#{index+1}" => car,
"item_number_#{index+1}" => 5,
"quantity_#{index+1}" => 1
})
end
"https://www.sandbox.paypal.com/cgi-bin/webscr?" + values.to_query
end


end

it is unable to identify it

what is the problem


Cheers


--
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.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/ph2CGAAof2cJ.
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 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 https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

Putting aside the fact that you didn't give enough information about to diagnose the problem, I'll only answer because it's obvious. 


The answer to your question lies in the origins of the @cart instance variable. It's not defined automagically;  you should define it in the controller, and you are most likely forgetting to do it.


On Sat, Sep 1, 2012 at 12:43 AM, Khan <emailtosameenakhan@gmail.com> wrote:
Hi all i am following this like for basic paypal http://railscasts.com/episodes/141-paypal-basics
and i got this error


View:

<%= link_to "Checkout", @cart.paypal_url() %>

undefined method `paypal_url' for nil:NilClass
despite i have this code in my model called Card

Cart Model:

class Cart < ActiveRecord::Base





def paypal_url(return_url)
values = {
:business => '',
:cmd => '_cart',
:upload => 1,
:return => return_url,
:invoice => id
}
line_items.each_with_index do |item, index|
values.merge!({
"amount_#{index+1}" => 500,
"item_name_#{index+1}" => car,
"item_number_#{index+1}" => 5,
"quantity_#{index+1}" => 1
})
end
"https://www.sandbox.paypal.com/cgi-bin/webscr?" + values.to_query
end


end

it is unable to identify it

what is the problem


Cheers


--
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.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/ph2CGAAof2cJ.
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 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 https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

Hi all i am following this like for basic paypal http://railscasts.com/episodes/141-paypal-basics
and i got this error


View:

<%= link_to "Checkout", @cart.paypal_url() %>

undefined method `paypal_url' for nil:NilClass
despite i have this code in my model called Card

Cart Model:

class Cart < ActiveRecord::Base





def paypal_url(return_url)
values = {
:business => '',
:cmd => '_cart',
:upload => 1,
:return => return_url,
:invoice => id
}
line_items.each_with_index do |item, index|
values.merge!({
"amount_#{index+1}" => 500,
"item_name_#{index+1}" => car,
"item_number_#{index+1}" => 5,
"quantity_#{index+1}" => 1
})
end
"https://www.sandbox.paypal.com/cgi-bin/webscr?" + values.to_query
end


end

it is unable to identify it

what is the problem


Cheers


--
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.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/ph2CGAAof2cJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

Colin,
    You had referred me to this link:
I thought it would be a good idea to learn this in a linux environment.  My apps on the web will be in Linux.  I setup a virtualbox for Windows and installed Ubuntu Server 12.04.  This part I did separately as I was learning Linux for web development. 
I got all the way down to starting the WEBrick server, with everything looking good and it said that it is running on port 3000.  And I should be able to browse to http://localhost:3000
and I get "Unable to Connect"
 
which was shown in the terminal window.
 
Since, I currently only have the server and not the gui for Linux Ubuntu, I thought I should be able to see this from my host operating system, Windows. 
Also, when I installed phpmyadmin, the instructor said that we should be able to get there using http://localhost:8080/phpmyadmin/
If I leave off the phpmyadmin, the page that comes up shows that the server is running and I get a message that just says "It works" – a bit of code to show that things are working. 
The instructor has us install this in the folder /etc/phpadmin
but when we installed Symfony, we were supposed to use folder /media/sf_sandbox/ 
I tried to get to that folder and was told I didn't have permission.  I couldn't use sudo cd as that just said that cd is not recognized. 
 
So, I obviously have rvm, ruby and gems installed but nothing beyond that is working in the way of getting a ruby on rails test app running.
Thanks in advance for any help,
Bruce

Colin
27 August 2012 at 9:26 PM, Dheeraj Kumar wrote:
@Colin:
 
Railsready can be used for any environment. The only thing it installs that is not usually used for a development environment is Passenger. Railsready is great because it simplifies the task of installing dependencies. I've done it manually, and this is so much more fun :)
 
 
Dheeraj Kumar
 

On Monday 27 August 2012 at 9:12 PM, Colin Law wrote:

On 27 August 2012 16:17, Dheeraj Kumar <a.dheeraj.kumar@gmail.com> wrote:
Hi Bruce,
 
I can understand the problems you're going through, as I've faced them
myself. They stem from some misconceptions about the language & the
framework.
 
Getting started with rails is probably the easiest thing to do out of all
the language stacks available. If you're using OSX or Linux, use
https://github.com/joshfng/railsready on a fresh install of your OS, and
you're set.
 
I have not met that one, it seems as if it may be more geared towards
a production server than development. I believe most would not use
passenger, nginx or apache on development machines.
 
This one looks like a reasonable alternative tutorial for installing
 
Colin
 
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
 

 
 

Ruby on Rails

Hai!

  This tutorials is help for you ...

   http://guides.rubyonrails.org/association_basics.html


by
bdeveloper01

--
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 https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

DelayedJob just creates anotar thread and a send the email or execute the method on parallel without stop the ruby thread! You can set a delay to call the method but it does not works as you throught!

;)

Sent from my iPhone

On 31/08/2012, at 23:47, Karthikeyan A k <lists@ruby-forum.com> wrote:

> Hello People,
>
> I just want to know how the delay job gem works. I am confused how it
> detects when the server is having less load and does computing intensive
> job at that time.
>
> Or it just tries to do some thing, if it fails, waits for random time
> and does it again?
>
> --
> 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 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 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 https://groups.google.com/groups/opt_out.

Ruby on Rails

Hello People,

I just want to know how the delay job gem works. I am confused how it
detects when the server is having less load and does computing intensive
job at that time.

Or it just tries to do some thing, if it fails, waits for random time
and does it again?

--
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 https://groups.google.com/groups/opt_out.

Ruby on Rails

It's a feature of Rails. It's a problem if it causes problems. With the sort of routing you have, it's only going to expose the views you indicate in your routes.rb file. If you had a more liberal route like

match 'info/:action' => 'info#action'

then it would show any action.html you placed in the views/info folder, as long as it was requested properly.

Walter

On Aug 31, 2012, at 5:32 PM, 7stud -- wrote:

> So this is a route "problem"?
>
> --
> 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 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 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 https://groups.google.com/groups/opt_out.

Ruby on Rails

So this is a route "problem"?

--
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 https://groups.google.com/groups/opt_out.

Ruby on Rails

Hi

We are looking for a strong Ruby on Rails developer in Golden, CO. Post your resumes to pradeept at hrgiants.com or call me at 510 870 2315. PDT

Description:
Join our agile team of Ruby on Rails developers building wireless home automation services in Golden, Colorado. We're developing with leading-edge technologies for a global market, and are looking for bright, capable web developers with front-end, back-end, or full stack experience.

If you have a background in web development or Ruby on Rails development we would like to talk with you.

You will be working with:

* Rails

* SASS, HAML, SLIM

* JQuery

* RSpec/Cucumber

* RabbitMQ

* Resque

* Mobile apps (Android, iPhone)

* MySQL/NoSQL

* Z-Wave wireless devices

* Video streaming

* Linux

-- 
Pradeep 
Technical Recruiter 
HR GIANTS 
http://www.hrgiants.c...
pradeept@hrgiants.com 
Tel : 1-510-870-2315 
Fax: 1-415-367-2525 

--
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.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/PvcQ9nZkvJUJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

On Aug 31, 2012, at 4:10 PM, 7stud -- wrote:

> Thanks for the response. Here is my routes.rb:
>
>
> SampleApp25::Application.routes.draw do
> get "static_pages/home"
> get "static_pages/help"
> get "static_pages/about"
> get "static_pages/contact"


Yup. I can confirm that with a similar route here in an otherwise entirely empty controller and a matching view in the correct folder, this just works without any logic at all. Let's hear it for convention over configuration!

Walter

--
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 https://groups.google.com/groups/opt_out.

Ruby on Rails

Thanks for the response. Here is my routes.rb:


SampleApp25::Application.routes.draw do
get "static_pages/home"
get "static_pages/help"
get "static_pages/about"
get "static_pages/contact"


# The priority is based upon order of creation:
# first created -> highest priority.

# Sample of regular route:
# match 'products/:id' => 'catalog#view'
# Keep in mind you can assign values other than :controller and
:action

# Sample of named route:
# match 'products/:id/purchase' => 'catalog#purchase', :as =>
:purchase
# This route can be invoked with purchase_url(:id => product.id)

# Sample resource route (maps HTTP verbs to controller actions
automatically):
# resources :products

# Sample resource route with options:
# resources :products do
# member do
# get 'short'
# post 'toggle'
# end
#
# collection do
# get 'sold'
# end
# end

# Sample resource route with sub-resources:
# resources :products do
# resources :comments, :sales
# resource :seller
# end

# Sample resource route with more complex sub-resources
# resources :products do
# resources :comments
# resources :sales do
# get 'recent', :on => :collection
# end
# end

# Sample resource route within a namespace:
# namespace :admin do
# # Directs /admin/products/* to Admin::ProductsController
# # (app/controllers/admin/products_controller.rb)
# resources :products
# end

# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
# root :to => 'welcome#index'

# See how all your routes lay out with "rake routes"

# This is a legacy wild controller route that's not recommended for
RESTful applications.
# Note: This route will make all actions in every controller
accessible via GET requests.
# match ':controller(/:action(/:id))(.:format)'
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 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 https://groups.google.com/groups/opt_out.

Ruby on Rails

On Aug 31, 2012, at 2:49 PM, 7stud -- wrote:

> 1) Yes, the page shows when I start rails server, and then use the url:
>
> http://localhost:300/static_pages/home
>
> 2) Everything in public/ was created by rails new:
>
> $ ls public/
> 404.html 500.html index.html
> 422.html favicon.ico robots.txt
>
>
> 3) test.log:
>
> Started GET "/static_pages/home" for 127.0.0.1 at 2012-08-31 10:04:28
> -0700
> Processing by StaticPagesController#home as HTML
> Rendered static_pages/home.html.erb within layouts/application (3.7ms)
> Completed 200 OK in 21ms (Views: 20.0ms | ActiveRecord: 0.0ms)
> [1m[35m (0.1ms)[0m rollback transaction
> [1m[36m (0.1ms)[0m [1mbegin transaction[0m
>
>
> Started GET "/static_pages/home" for 127.0.0.1 at 2012-08-31 10:04:28
> -0700
> Processing by StaticPagesController#home as HTML
> Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)
> [1m[35m (0.1ms)[0m rollback transaction
> [1m[36m (0.1ms)[0m [1mbegin transaction[0m
>
>
>
> Yet here is my controller:
>
> class StaticPagesController < ApplicationController
> end
>
> Previously, I had actions in my controller, but I wanted to see if the
> tests would fail without the actions, and I fully expected them to fail,
> but they won't. I have everything at github:
>
> https://github.com/7stud/sample_app25
>
> Curiously, if I write a test for a non-existent view, I get three
> errors: First, no route; then after I add the route:
>
> get '/static_pages/something'
>
> I get an error saying there's no action; then after I add the action, I
> get an error saying there's no view; then after adding a view, the test
> passes. Subsequently, if I delete the action for that view, the test
> still passes. Why?

What's in your routes.rb? This could be a catch-all route firing. In Ryan Bates' Railscast on semi-static pages, he mentions that a completely empty controller will work as long as there is a properly named view file at the expected path. I tried it in a quick test app, but it didn't work in vanilla 3.2.

Walter

--
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 https://groups.google.com/groups/opt_out.

Ruby on Rails

1) Yes, the page shows when I start rails server, and then use the url:

http://localhost:300/static_pages/home

2) Everything in public/ was created by rails new:

$ ls public/
404.html 500.html index.html
422.html favicon.ico robots.txt


3) test.log:

Started GET "/static_pages/home" for 127.0.0.1 at 2012-08-31 10:04:28
-0700
Processing by StaticPagesController#home as HTML
Rendered static_pages/home.html.erb within layouts/application (3.7ms)
Completed 200 OK in 21ms (Views: 20.0ms | ActiveRecord: 0.0ms)
[1m[35m (0.1ms)[0m rollback transaction
[1m[36m (0.1ms)[0m [1mbegin transaction[0m


Started GET "/static_pages/home" for 127.0.0.1 at 2012-08-31 10:04:28
-0700
Processing by StaticPagesController#home as HTML
Completed 200 OK in 2ms (Views: 1.6ms | ActiveRecord: 0.0ms)
[1m[35m (0.1ms)[0m rollback transaction
[1m[36m (0.1ms)[0m [1mbegin transaction[0m



Yet here is my controller:

class StaticPagesController < ApplicationController
end

Previously, I had actions in my controller, but I wanted to see if the
tests would fail without the actions, and I fully expected them to fail,
but they won't. I have everything at github:

https://github.com/7stud/sample_app25

Curiously, if I write a test for a non-existent view, I get three
errors: First, no route; then after I add the route:

get '/static_pages/something'

I get an error saying there's no action; then after I add the action, I
get an error saying there's no view; then after adding a view, the test
passes. Subsequently, if I delete the action for that view, the test
still passes. Why?

--
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 https://groups.google.com/groups/opt_out.

Ruby on Rails

hi! since the css and js is the zurb foundation, I realize I can install
the gem, and I follow the how to in the home page at git-hub
(https://github.com/zurb/foundation-rails), and I get stuck in "Using
foundation in production", I cant use capistrano because I don't know
where is the capfile.. so after install it, I create the capfile and
then add the 2 lines the tutorial say me, and then run the "cap deploy"
command, and this I get:


$ cap deploy

* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
Please specify the repository that houses your application's code, set
:repository, 'foo'
*** [deploy:update_code] rolling back
Please specify the name of your application, set :application, 'foo'
** [deploy:update_code] exception while rolling back: SystemExit,
Please specify the name of your application, set :application, 'foo'

And I don't undesrtand this... I am doing anything wrong?

Then in the capistrano webpage I didn't found any help...

Then I tryied "To compile on-the-fly" (in the git-hub page), and when I
go to my page it doesn't work and looks like since I install foundation
gem, with this message:


Sprockets::FileNotFound in Static_pages#index

Showing
/home/usuario/ruby/proyectosRoR/volei_2/app/views/layouts/application.html.erb
where line #10 raised:

couldn't find file 'foundation'
(in
/home/usuario/ruby/proyectosRoR/volei_2/app/assets/stylesheets/application.css:12)

Extracted source (around line #10):

7:
8: <head>
9: <title>Volei2</title>
10: <%= stylesheet_link_tag "application", :media => "all" %>
11: <%= javascript_include_tag "application" %>
12: <%= csrf_meta_tags %>
13: </head>

Rails.root: /home/usuario/ruby/proyectosRoR/volei_2
Application Trace | Framework Trace | Full Trace

app/views/layouts/application.html.erb:10:in
`_app_views_layouts_application_html_erb___140248591_80812530'

Request

Parameters:

None

Show session dump

Show env dump
Response

Headers:

None


buuuut in the sprockets there are all ok I think:

app/assets/stylesheets/application.css

*= require "foundation"
*= require_self
*= require foundation_and_overrides
*= require_tree .

and app/assets/javascripts/application.js

//= require "foundation"
//= require jquery
//= require jquery_ujs
//= require foundation
//= require_tree .



I am having a headache with only try to put some css and js in my static
page.. please, what am I doing wrong??

thanks in advance!

--
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 https://groups.google.com/groups/opt_out.

Ruby on Rails

I guess you are looking for this or probably i misunderstood your question

def show
  @question = Question.find(params[:id])
  @user = @question.user
end


On Fri, Aug 31, 2012 at 8:56 PM, Nate FT <lists@ruby-forum.com> wrote:
I have a User and a Question model, User has_many questions and Question
belongs_to user.

On my question show page, I show a question, along with the name of the
user who's asking the question.

Everything seems to be working fine, but my controller looks like this:

questions_controller.rb
.
.
.
def show
  @question = Question.find(params[:id])
  @user = User.find(@question.user_id)
end


I know rails must have a less messy way to figure out which user the
question belongs to. I've read that using something like question.user
would give me what I need, but I can't figure out how to implement it in
my controller.

Sorry for the simple question, any suggestions are appreciated. Thanks!

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

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





--
Thanks, 
Aash

--
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 https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

On 31 August 2012 16:26, Nate FT <lists@ruby-forum.com> wrote:
> I have a User and a Question model, User has_many questions and Question
> belongs_to user.
>
> On my question show page, I show a question, along with the name of the
> user who's asking the question.
>
> Everything seems to be working fine, but my controller looks like this:
>
> questions_controller.rb
> .
> .
> .
> def show
> @question = Question.find(params[:id])
> @user = User.find(@question.user_id)
> end
>
>
> I know rails must have a less messy way to figure out which user the
> question belongs to. I've read that using something like question.user
> would give me what I need, but I can't figure out how to implement it in
> my controller.

@user = @question.user
but in fact there is no need to do that in the controller. In the
view just use @question.user.name or whatever it is. That assumes
that every question will have a user, if there is any chance that a
question will not have a user then @question.user.name would fail as
user would be nil, so you would have to cope with that.

Since you are asking the question I suggest that you work through a
good tutorial which would give the basics of rails. railstutorial.org
is good and is free to use online.

Colin

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

Ruby on Rails

I have a User and a Question model, User has_many questions and Question
belongs_to user.

On my question show page, I show a question, along with the name of the
user who's asking the question.

Everything seems to be working fine, but my controller looks like this:

questions_controller.rb
.
.
.
def show
@question = Question.find(params[:id])
@user = User.find(@question.user_id)
end


I know rails must have a less messy way to figure out which user the
question belongs to. I've read that using something like question.user
would give me what I need, but I can't figure out how to implement it in
my controller.

Sorry for the simple question, any suggestions are appreciated. Thanks!

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

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

Ruby on Rails

Hey gang:
I'm looking for a ruby person to do work for a client of mine in Providence RI.  Please message me or email me at elizabeth.conlin@rht.com if you are available.
 
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.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/Pui7Iy7CZ5MJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

On Friday, 31 August 2012 09:03:40 UTC-5, Fahim Patel wrote:

can one explain this issue?

On Thursday, August 16, 2012 10:33:47 AM UTC+5:30, Fahim Patel wrote:
let me explain this problem ........
-------------------rails destroy----------------------------this command destroy model,scaffold etc .....
problem is that if a model or other structure is exist than ,this command will destroy all the related file to it.......good ..till now no problem...........
but problem is that if a model etc is not exist than till this command remove the file ...it should not be done.....there is no such a file name exist..........
some error or exception should be execute at this time ....

i think this a problem???
if not than expalin me..........

It's not deleting anything.  Even though it claims it is it's just cruft in the terminal.  It's impossible to delete something that doesn't exist, well I should not say impossible as anything is possible but none-the-less the cruft is still outputted even if it does not delete anything.  Perhaps you should file a rails bug and ask them to adjust the message to imply "trying" instead of implying "doing". 

--
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.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/l8a8h9EFxqgJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

On Friday, 31 August 2012 08:59:48 UTC-5, Fahim Patel wrote:

can we write multiple background in one feature file....?

No.
 
can we write multiple feature in one feature file.....?

Yes.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/G6AxXF4dRUcJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

On Fri, Aug 31, 2012 at 8:59 AM, Fahim Patel <pafahim@gmail.com> wrote:
> can we write multiple background in one feature file....?

No.

> can we write multiple feature in one feature file.....?

Yes.

Read: http://pragprog.com/book/hwcuc/the-cucumber-book

--
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 https://groups.google.com/groups/opt_out.

Ruby on Rails

On 31 August 2012 15:03, Fahim Patel <pafahim@gmail.com> wrote:
> can one explain this issue?
>
> On Thursday, August 16, 2012 10:33:47 AM UTC+5:30, Fahim Patel wrote:
>>
>> let me explain this problem ........
>> -------------------rails destroy----------------------------this command
>> destroy model,scaffold etc .....
>> problem is that if a model or other structure is exist than ,this command
>> will destroy all the related file to it.......good ..till now no
>> problem...........
>> but problem is that if a model etc is not exist than till this command
>> remove the file ...it should not be done.....there is no such a file name
>> exist..........
>> some error or exception should be execute at this time ....
>>
>> i think this a problem???
>> if not than expalin me..........

I think the most likely cause is that the keys on your keyboard are
sticking down causing all the repeated characters.

If you are referring to the fact that rails destroy attempts to delete
all the files that generate creates then that is just the way it is.
I don't think anyone really cares much how rails destroy works as it
is virtually never used. I don't think I have ever used it. If you
want to remove stuff you can just delete the files you don't want.

Colin

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

Ruby on Rails

can one explain this issue?

On Thursday, August 16, 2012 10:33:47 AM UTC+5:30, Fahim Patel wrote:

let me explain this problem ........
-------------------rails destroy----------------------------this command destroy model,scaffold etc .....
problem is that if a model or other structure is exist than ,this command will destroy all the related file to it.......good ..till now no problem...........
but problem is that if a model etc is not exist than till this command remove the file ...it should not be done.....there is no such a file name exist..........
some error or exception should be execute at this time ....

i think this a problem???
if not than expalin me..........

Regards 
Fahim Babar Patel

--
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.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/A-nJvV9JaygJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

can we write multiple background in one feature file....?

can we write multiple feature in one feature file.....?

--
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.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/KoIuuRV_AN4J.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

Hi,
     How to add validations to devise signup form,any help will be appreciated,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.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/SpFhQymK-fYJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

The error says that the route is not found.

For debugging, you need to check your routes.
Try:

rake routes | grep pay_bill

Something should show up, since the tutorials says to put this in the
routes file:

match '/billing', :to => 'billing#create', :as => :pay_bill


Maybe rereading:

http://guides.rubyonrails.org/routing.html#adding-more-restful-actions

helps too


On Fri, Aug 31, 2012 at 1:25 PM, sameena Khan
<emailtosameenakhan@gmail.com> wrote:
> here is the link
> http://www.funonrails.com/search?q=paypal&imageField.x=0&imageField.y=0&max-results=10
>
>
>
> On Fri, Aug 31, 2012 at 4:53 PM, Khan <emailtosameenakhan@gmail.com> wrote:
>>
>> Hi all i found this link for paypal integration and in the process i got
>> this error
>>
>> undefined local variable or method `pay_bill_url'
>>
>> what does it means
>>
>>
>> Cheers
>>
>> Khan
>>
>>
>> --
>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/rubyonrails-talk/-/wbpzRsszeKAJ.
>> 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 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 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 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 https://groups.google.com/groups/opt_out.

Ruby on Rails

here is the link http://www.funonrails.com/search?q=paypal&imageField.x=0&imageField.y=0&max-results=10


On Fri, Aug 31, 2012 at 4:53 PM, Khan <emailtosameenakhan@gmail.com> wrote:
Hi all  i found this link for paypal integration and in the process i got  this error
undefined local variable or method `pay_bill_url'

what does it means


Cheers
Khan

--
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.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/wbpzRsszeKAJ.
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 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 https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

Hi all  i found this link for paypal integration and in the process i got  this error

undefined local variable or method `pay_bill_url'

what does it means


Cheers
Khan

--
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.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/wbpzRsszeKAJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

Hi i was following this link http://www.funonrails.com/search?q=paypal&imageField.x=0&imageField.y=0&max-results=10 for PayPal integration in the process i got this error

undefined local variable or method `pay_bill_url' for #<#<Class:0x927b3f8>:0x92794b8>


View Name:create
<%= form_for @payment ||= Payment.new, :url => pay_bill_url, :html => {:id => :payForm} do |p| %>
<%=p.text_field :amount%>
<%=p.submit 'Pay'%>
<% end %>

Controller Name: billing


class BillingController < ApplicationController
before_filter :get_order, :only => [:checkout, :paypal, :thank_you]


def new
@payment = Payment.new params[:payment]
if @payment.save
## Paypal Checkout page
redirect_to billing_url
else
render :action => :new
end
end


def create

end

# ASSUMPTION
# order is valid i.e. amount is entered

def checkout
response = @order.setup_purchase(:return_url => confirm_paypal_url(@order), :cancel_return_url => root_url)
redirect_to @order.redirect_url_for(response.token)
end

## CALL BACK
def paypal
@order = @order.purchase(:token => params[:token], :payer_id => params[:PayerID], :ip => request.remote_ip)
@order.save redirect_to thank_you_billing_url(@order)
end

private
def get_order
@order = Payment.find_by_id(params[:id])
@order && @order.valid? || invalid_url
end




end

Routes:
match 'billing/create' => 'billing#create'
## Callback URL
match '/billing/paypal/:id/confirm', :to => 'billing#paypal', :as => :confirm_paypal
## Create payment
#match '/billing', :to => 'billing#create', :as => :pay_bill
### Request URL
match '/billing/paypal/:id', :to => 'billing#checkout', :as => :billing
match '/billing/thank_you/:id', :to => 'billing#checkout', :as => :billing_thank_you


Cheers

--
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.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/coAAsT9DYEcJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

On 31 August 2012 08:59, Joshua Baldock <lists@ruby-forum.com> wrote:
> Message column and example message looks like this:
>
> "The [user] is logged in via [hostname]"

I assume the square brackets are not in the string, so that a real
string might look like :

"The administrator is logged in via michael-desktop"
?

If so, you'll probably want to play with some string matching methods.
http://www.ruby-doc.org/core-1.9.3/String.html

"match" is a good place to start.

class MyModel < AR::Base
# my model has a big string field called "note_details", from
# which I want to extract the username and hostname values

def username
note_details.match(/The (\S*) is logged in via (\S*)/)[1]
end

def hostname
note_details.match(/The (\S*) is logged in via (\S*)/)[2]
end
end

in the view you can access @my_model.username and @my_model.hostname
like any other attributes. If you have any issue with performance, you
could memoize the results, so you only run the .match once.

HTH

--
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 https://groups.google.com/groups/opt_out.

Ruby on Rails

Michael Pavling wrote in post #1074020:
> On 31 August 2012 08:20, Joshua Baldock <lists@ruby-forum.com> wrote:
>> Splitting the string and then storing them as additional attributes to
>> the instance variable that contains the rest of the selected table
>> values.
>
> Do you have an example of the string; the pattern that similar
> instances would follow, and the components you need it split into?

Thanks Michael,

Message column and example message looks like this:

"The [user] is logged in via [hostname]"

When i query the database and get back each of these matching rows, i
would like to be able to split [user] and [hostname] into a user and
host attributes so that i can call those attributes on my view

--
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 https://groups.google.com/groups/opt_out.

Ruby on Rails

On 31 August 2012 08:20, Joshua Baldock <lists@ruby-forum.com> wrote:
> Splitting the string and then storing them as additional attributes to
> the instance variable that contains the rest of the selected table
> values.

Do you have an example of the string; the pattern that similar
instances would follow, and the components you need it split into?

--
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 https://groups.google.com/groups/opt_out.

Ruby on Rails

Michael Pavling wrote in post #1074016:
> On 31 August 2012 07:41, Joshua Baldock <lists@ruby-forum.com> wrote:
>> I have an existing database that im building a rails app on top of. One
>> of my columns 'message' is a long string that I would like to be able to
>> query and split into various attributes to then be able to display each
>> of those attributes in a view.
>>
>> I'm trying to implement this into the controller, but don't seem to be
>> getting any where.
>
> Which bit are you having trouble with? Accessing the legacy table?
> Splitting the string? Displaying it in a view?

Splitting the string and then storing them as additional attributes to
the instance variable that contains the rest of the selected table
values.

--
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 https://groups.google.com/groups/opt_out.

Ruby on Rails

Jordon Bedwell wrote in post #1074013:
> On Friday, 31 August 2012 01:42:10 UTC-5, Ruby-Forum.com User wrote:
>
> I don't quite understand exactly what you mean but it sounds to me like
> you
> want a custom serializer.
>
http://stackoverflow.com/questions/4472479/custom-serialization-for-fields-in-rails

Maybe some example information may help :)

The table in my database has a few different collumns, one of which is
"message". In this column and example message looks like this:

"The [user] is logged in via [hostname]"

When i query the database and get back each of these matching rows, i
would like to be able to split [user] and [hostname] into a user and
host attributes so that i can call those attributes on my view, rather
then have logic in my view that takes the message attribute and breaks
it up for each row.

Please let me know if im still not making sense.

Thanks for your help.

--
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 https://groups.google.com/groups/opt_out.

Ruby on Rails

On 31 August 2012 07:41, Joshua Baldock <lists@ruby-forum.com> wrote:
> I have an existing database that im building a rails app on top of. One
> of my columns 'message' is a long string that I would like to be able to
> query and split into various attributes to then be able to display each
> of those attributes in a view.
>
> I'm trying to implement this into the controller, but don't seem to be
> getting any where.

Which bit are you having trouble with? Accessing the legacy table?
Splitting the string? Displaying it in a view?

--
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 https://groups.google.com/groups/opt_out.

Ruby on Rails



On Wednesday, 29 August 2012 08:07:18 UTC-5, Ruby-Forum.com User wrote:

My controller code is as follows,


  def index
  end

  def show
    if params[:cat_id]
    # cat_id is fetched from DB(a table with two columns id and name)
    #mapped as cat_id in routes file
      @articles = Article.find_all_by_name(params[:cat_id].gsub(/\-/, '
'))
      render :action => :index
    end
  end

How to do pagination using will_paginate on this.

Here @articles is an array which fetches articles based on category
names. The output of this is as follows,

An index page with 3 category names and relevant articles under each
category. Now i need to apply will_paginate under each category in index
page. How to do this. Adding ".paginate(:page => params[:page],
:per_page =>3) returns undefined method 'total pages' since its an
array. Could you please advise me as to how pagination can be done.
Further, the url structure is article/categoryname/articlename (formed
using slug).


Use where instead of the find_by helpers.

`Article.where("name = ?", params[:cat_id].gsub(/\-/, '')).paginate({
  :page => params[:page], :per_page =>3 })`

find_all_by_* does it's job literally, it finds them all and it defeats the logic in it's name to add pagination to it.  So if you want pagination use where.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/nwdMDP2b1RUJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails Thursday, August 30, 2012



On Friday, 31 August 2012 01:42:10 UTC-5, Ruby-Forum.com User wrote:

Hi All,

I'm new to rails and am trying to tackle a problem that I can't seem to
find the right solution for.

I have an existing database that im building a rails app on top of. One
of my columns 'message' is a long string that I would like to be able to
query and split into various attributes to then be able to display each
of those attributes in a view.

I'm trying to implement this into the controller, but don't seem to be
getting any where.

Can you please let me know how I can achieve this within rails?


I don't quite understand exactly what you mean but it sounds to me like you want a custom serializer. http://stackoverflow.com/questions/4472479/custom-serialization-for-fields-in-rails 

--
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.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/6lDoxISEdbUJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

Hi All,

I'm new to rails and am trying to tackle a problem that I can't seem to
find the right solution for.

I have an existing database that im building a rails app on top of. One
of my columns 'message' is a long string that I would like to be able to
query and split into various attributes to then be able to display each
of those attributes in a view.

I'm trying to implement this into the controller, but don't seem to be
getting any where.

Can you please let me know how I can achieve this within rails?

--
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 https://groups.google.com/groups/opt_out.

Ruby on Rails

On 30 August 2012 22:29, 7stud -- <lists@ruby-forum.com> wrote:
> The rspec test looks like this:
>
>
> require 'spec_helper'
>
> describe "Static pages" do
>
> describe "Home page" do
>
> it "should have the h1 'Sample App'" do
> visit '/static_pages/home'
> page.should have_selector('h1', :text => 'Sample App')
> end
>
> end
>
> end
>
>
> My controller looks like this:
>
> class StaticPagesController < ApplicationController
> end

If you go to that url in the browser does it show a page with the header?

Is there a page in public/static_pages that matches that url? In
which case that will be served without the need for a controller
action.

What does test.log show when you run the test?

Colin

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

Ruby on Rails

The rspec test looks like this:


require 'spec_helper'

describe "Static pages" do

describe "Home page" do

it "should have the h1 'Sample App'" do
visit '/static_pages/home'
page.should have_selector('h1', :text => 'Sample App')
end

end

end


My controller looks like this:

class StaticPagesController < ApplicationController
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 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 https://groups.google.com/groups/opt_out.

Ruby on Rails

Hi
I m trying to do my first aplication in rails. I use oficial tutorial http://guides.rubyonrails.cz/#hello-world-v-rails and I have a problem with one of steps.
When I executed $ rake db:create (or only rake), I got an erorr:
Could not find coffee-script-source-1.3.3 in any of the sources
Run `bundle install` to install missing gems.

Before it I did step I did other steps.
thanks for 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.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/tKpq1lizWjwJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

thanks

On Thu, Aug 30, 2012 at 9:20 PM, Tak G. <lists@ruby-forum.com> wrote:
I think its safe to say that a web developer has to be ambiguous.  and
so learning multiple languages for backend web dev would be optimal.  so
your question was if it is a good idea to learn ruby on rails?
absolutely.

--
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.

--
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 https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

On Aug 30, 2012, at 11:51 AM, Dean Chester wrote:

> Have a look at Devise, theres a good rails cast on using it.
>
> http://railscasts.com/episodes/209-introducing-devise
>
> Dean

And beaucoup plug-ins like Ominauth to deal with multi-provider authentication.

Walter

> On 30 Aug 2012, at 16:44, Nelson André wrote:
>
>> Hello all,
>>
>> I'm new to RoR and I'm building my first app.
>>
>> Is there a most used recipe or procedure to create a Registration/Login mechanism that gives the ability to register with a set of fields (name, login, email, password) or use Facebook/Twitter ?
>>
>> Something that is more or less standard?
>>
>> Many 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.
>> To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/NZA8wW3-D_kJ.
>> 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 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 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 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 https://groups.google.com/groups/opt_out.

Ruby on Rails

Have a look at Devise, theres a good rails cast on using it. 



Dean 
On 30 Aug 2012, at 16:44, Nelson André wrote:

Hello all,

I'm new to RoR and I'm building my first app.

Is there a most used recipe or procedure to create a Registration/Login mechanism that gives the ability to register with a set of fields (name, login, email, password) or use Facebook/Twitter ?

Something that is more or less standard?

Many 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.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/NZA8wW3-D_kJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

I think its safe to say that a web developer has to be ambiguous. and
so learning multiple languages for backend web dev would be optimal. so
your question was if it is a good idea to learn ruby on rails?
absolutely.

--
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 https://groups.google.com/groups/opt_out.

Ruby on Rails

Hello all,


I'm new to RoR and I'm building my first app.

Is there a most used recipe or procedure to create a Registration/Login mechanism that gives the ability to register with a set of fields (name, login, email, password) or use Facebook/Twitter ?

Something that is more or less standard?

Many 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.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/NZA8wW3-D_kJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ruby on Rails

On Aug 30, 2012, at 5:24 AM, tundrax wrote:
>>
>>
>>
>> On Thursday, August 30, 2012 4:29:25 AM UTC+9, Walter Lee Davis wrote:
>> I just switched a project from Dragonfly to Carrierwave, specifically to see if I could take advantage of Carrierwave Direct, which uploads large files directly to S3 or another cloud storage.
>>
>> I was able to make a form containing a single file field that would upload to S3. What I could not work out was how to upload the file to S3 AND other form elements to the model that had Carrierwave mounted on it. I ended up punting and just doing the two-step upload to the server and server stores the file in S3 using regular Carrierwave (not Direct).
>>
>> Can anyone point me to an example of Carrierwave Direct that incorporates other form fields saved into the same ActiveRecord as the Carrierwave details?
>>
>> Thanks,
>>
>> Walter
>
> Docs say you should use Fog gem
>
> https://github.com/jnicklas/carrierwave#using-amazon-s3
>
> And it doesn't matter what storage you chose, local filesystem, S3 or any other cloud storage.
> Your form is submitted and the location of uploaded file, along with other attributes of the model you are editing
> are stored in the database. So, you question
>
> >> What I could not work out was how to upload the file to S3 AND other form elements to the model that had Carrierwave mounted on it.
>
> is inappropriate.

Sorry, what?

I was able to make a form containing a single file field which would upload using Carrierwave _Direct_ to upload to S3 without my server acting as a middle-man. I was not able to suss out how to combine such a file field with other fields intended for my server's eyes.

I was perfectly able to create a single combined form which contained the file AND its metadata, upload both to my server, and yes, using Fog, store the file on S3. That's with ordinary Carrierwave, which is lovingly documented and a drop-in replacement for nearly every other file storage scheme on Rails.

The issue, which I still do not understand how to solve without an Ajax sidecar submitting two forms at once, is how to send part of the data directly to S3 and the remainder to my server, and maintain a connection between the two.

If you can help, I would appreciate it.

Walter

--
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 https://groups.google.com/groups/opt_out.