rubyonrailsin

A Ruby and Rails talk

Friday, March 12, 2010

Re: [Rails] Re: "We're sorry, but something went wrong." from RoR app

by rubyonrailsin 0 comments
Try reinstalling mysql gem!

On Sat, Mar 13, 2010 at 1:07 AM, Aldric Giacomoni <lists@ruby-forum.com> wrote:
RichardOnRails wrote:
> Hi All,
>
> "We're sorry, but something went wrong." is the message I got when I
> started up an RoR app in the environment:
>
> Rails 2.3.5
> Ruby 1.8.6
> WinXP-Pro/SP3
> Firefox 3.6
> MySQL 5.0.37-community-nt
> Mongrel
>
> The app under development was working fine until I (stupidly) thought
> I needed to upgrade MySQL to 5.1.44.
>

http://trevoke.net/blog/2009/09/25/fix-for-windows-rails-2-2-mysql-5-1-error/

I think you may have a similar issue. The post may not solve your issue,
but it should get you going in the right direction.
--
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.




--
Sandip

---
www.funonrails.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.
Read More…

[spree-user] Re: Each time cart link is hit an empty order is created

by rubyonrailsin 0 comments
> Any thoughts?

* Don't show 'Cart' link while cart is empty
* Remove old, empty orders by cron

On Mar 12, 6:12 pm, Sergei <s.n.koz...@gmail.com> wrote:
> Hi guys,
>
> I encountered a problem that must have been addressed by someone, but
> I can't find where. I'm a newbie Spree user.
>
> Each time someone hits the Cart link, an empty order gets created in
> the database, which leaves me with hundreds of empty orders a day. I
> guess that more logical would be actually creating an order at a
> checkout, but I may miss something.
>
> Any thoughts?
>
> Cheers!
>
> Sergei
> writelesscode.com

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

Read More…

[Rails] Re: association generated methods not working

by rubyonrailsin 0 comments
Thank you so much. That solved it. I can't believe I didn't try
changing that. I could have sworn singular was the way it was done in
the guides and tutorials. knowing when to use plural and when to use
singular is confusing. actually when you think about it it always makes
sense but for some reason it just doesn't click with me.

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

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To 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.

Read More…

[Rails] Re: Protecting static assets

by rubyonrailsin 0 comments
Geoffroy Gomet wrote:
> How can I protect static assets behind authentication.
> I'm familliar with protecting dynamic pages but how to protect static
> files?
>
> An example would be : someone login to my application, upload a
> picture and authorize only some users to see this picture.
> How to avoid someone to access the picture, even if this pperson knows
> the correct url of the file.
>
> The solution is probably to let rails handle static files, but how to
> force this behavior and how to handle differents file types (probably
> through sendfile).

In most production environments web resources (files under
$RAILS_ROOT/public) are served to the client by the web server (Apache,
Nginx, etc.). Your Rails application, and therefore your authentication,
are not involved at all.

The easiest solution is to move the files you want to deliver outside of
the public folder and serve them to the client from your Rails
application using send_file:

http://railsapi.com/doc/rails-v2.3.5/classes/ActionController/Streaming.html#M001587

Take special note of the :x_sendfile option. This will basically hand
the bulk of the file streaming back to Apache. With send_file you'll be
able to control access to the protected files, by whatever means you
wish. You would then be able to send the files just as you would
normally send html to the client using Rails routing and controller
actions.
--
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.

Read More…

Re: [Rails] association generated methods not working

by rubyonrailsin 0 comments
Following just a quick look at the code see below for some obvious issues.

On 12 March 2010 19:43, Martin Colwell <lists@ruby-forum.com> wrote:
> I'm definitely a noob to rails so sorry if this is trivial.  I have
> tables with associations on them.  The associations are supposed to add
> methods to my models like model.others and model.others= and so on but
> when I try to use them I get errors like the following.
>
> NoMethodError: undefined method `states' for #<Ad:0x2c8a88c>
>        from
> C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/attribute_methods.rb:260:in
> `method_missing'
>        from (irb):4
>
> I've followed the execution in the debugger and all that the
> method_missing seems to do is generate setters, getters and ? for the
> fields in the table, it doesn't seem to generate or look for any of the
> methods that
> http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html
> says it should. I only did this once though and I didn't really
> understand what I was reading
>
> My code is the following
>
> Model classes:
>
> file: app/models/ad.rb
> class Ad < ActiveRecord::Base
>  belongs_to :customer
>  has_and_belongs_to_many :state

That should be :states (plural)

> end
>
> file: app/models/state.rb
> class State < ActiveRecord::Base
>  has_and_belongs_to_many :ad

Should be :ads

>  has_many :zip_code

:zip_codes

>  has_many :town

:towns

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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Read More…

[Rails] Re: Showing video questions

by rubyonrailsin 0 comments
Hi,

I use Flowplayer at my website digiprof.tv , check it out and steal the
html+js code if that's what you need.
--
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.

Read More…

[Rails] Showing video questions

by rubyonrailsin 0 comments
Hi guys,

I need help about how I can display a video using javascript in ruby on rails?
I would like to display a video like in this example site http://www.origamirisk.com/ (if you see new video at the bottom, when you click it, it will display a video).

Do you know any plugins? or you have any advise?


Yudi Soesanto

--
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.
Read More…

[Rails] association generated methods not working

by rubyonrailsin 0 comments
I'm definitely a noob to rails so sorry if this is trivial. I have
tables with associations on them. The associations are supposed to add
methods to my models like model.others and model.others= and so on but
when I try to use them I get errors like the following.

NoMethodError: undefined method `states' for #<Ad:0x2c8a88c>
from
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/attribute_methods.rb:260:in
`method_missing'
from (irb):4

I've followed the execution in the debugger and all that the
method_missing seems to do is generate setters, getters and ? for the
fields in the table, it doesn't seem to generate or look for any of the
methods that
http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html
says it should. I only did this once though and I didn't really
understand what I was reading

My code is the following

Model classes:

file: app/models/ad.rb
class Ad < ActiveRecord::Base
belongs_to :customer
has_and_belongs_to_many :state
end

file: app/models/state.rb
class State < ActiveRecord::Base
has_and_belongs_to_many :ad
has_many :zip_code
has_many :town
end

Migration:

create_table :ads do |t|
t.integer :property_type_id
t.float :priority_weighting
t.float :price_min
t.float :price_max
t.float :distance_max
t.boolean :for_sale
t.boolean :for_lease
t.float :cost_per_click
t.float :cost_per_click
t.references :customer
t.binary :image_size_1
t.binary :image_size_2

t.timestamps
end

create_table "states", :force => true do |t|
t.string "name"
t.string "abbreviation"
end

create_table "ads_states", :force => true do |t|
t.integer "ad_id"
t.integer "state_id"
end

(actually I took this from schema.rb)

when I run script/console and play around I get this:

>> state = State.new
=> #<State id: nil, name: nil, abbreviation: nil>
>> state.save
=> true
>> ad = Ad.new
=> #<Ad id: nil, property_type_id: nil, priority_weighting: nil,
price_min: nil, price_max: nil, distance_max: nil, for_sale: nil,
for_lease: nil, cost_per_click: nil, customer_id: nil, image_size_1:
nil, image_size_2: nil, created_at: nil, updated_at: nil>
>> ad.state
=> []
>> ad.state_ids
=> []
>> ad.state_ids = [state.id]
=> [2]
>> ad.states
NoMethodError: undefined method `states' for #<Ad:0x419db84>
from
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/attribute_methods.rb:260:in
`method_missing'
from (irb):20
>> ad.states = [state]
NoMethodError: undefined method `states=' for #<Ad:0x419db84>
from
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/attribute_methods.rb:255:in
`method_missing'
from (irb):21
>> ad.states << [state]
NoMethodError: undefined method `states' for #<Ad:0x419db84>
from
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/attribute_methods.rb:260:in
`method_missing'
from (irb):22

I have similar problems with has_many however belongs_to seems to work.

I get the same exact problems when I try this in the controller.
I'm using Rails 2.3.5 and Ruby 1.8.7

Please let me know if you need any more info this is all I could think
of.
--
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.

Read More…

[spree-user] One-click Add to Cart

by rubyonrailsin 0 comments
I'm trying to implement a one click link that adds an item to a cart.

I can see older code that did that, but it references Cart.

Cart has been replaced with Order.

Is there an easy way with the edge to achieve this? Or do I need to
add some custom logic to the Order controller?

Thanks in advance.

--
Dustin Friel

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

Read More…

[Rails] Re: "We're sorry, but something went wrong." from RoR app

by rubyonrailsin 0 comments
RichardOnRails wrote:
> Hi All,
>
> "We're sorry, but something went wrong." is the message I got when I
> started up an RoR app in the environment:
>
> Rails 2.3.5
> Ruby 1.8.6
> WinXP-Pro/SP3
> Firefox 3.6
> MySQL 5.0.37-community-nt
> Mongrel
>
> The app under development was working fine until I (stupidly) thought
> I needed to upgrade MySQL to 5.1.44.
>

http://trevoke.net/blog/2009/09/25/fix-for-windows-rails-2-2-mysql-5-1-error/

I think you may have a similar issue. The post may not solve your issue,
but it should get you going in the right direction.
--
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.

Read More…

[Rails] "We're sorry, but something went wrong." from RoR app

by rubyonrailsin 0 comments
Hi All,

"We're sorry, but something went wrong." is the message I got when I
started up an RoR app in the environment:

Rails 2.3.5
Ruby 1.8.6
WinXP-Pro/SP3
Firefox 3.6
MySQL 5.0.37-community-nt
Mongrel

The app under development was working fine until I (stupidly) thought
I needed to upgrade MySQL to 5.1.44.

I took the precaution of MySQL-dumping
the development db before upgrading. Then I ran into problems which
led me to switch back to a clean install of 5.0.37 and reboot.

I used MySQL to reinstall the development db and tested it
successfully under the MySQL client.

I started up Mongrel and ran my app using localhost:3000, getting the
captioned message.

The development log is presented below. Suggestions are extremely
welcome.

Thanks in Advance,
Richard

Development.log
============
/!\ FAILSAFE /!\ Fri Mar 12 13:42:10 -0500 2010
Status: 500 Internal Server Error
Unknown database 'rts_development'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/connection_adapters/
mysql_adapter.rb:589:in `real_connect'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/connection_adapters/
mysql_adapter.rb:589:in `connect'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/connection_adapters/
mysql_adapter.rb:203:in `initialize'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/connection_adapters/
mysql_adapter.rb:75:in `new'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/connection_adapters/
mysql_adapter.rb:75:in `mysql_connection'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/connection_adapters/abstract/
connection_pool.rb:223:in `send'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/connection_adapters/abstract/
connection_pool.rb:223:in `new_connection'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/connection_adapters/abstract/
connection_pool.rb:245:in `checkout_new_connection'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/connection_adapters/abstract/
connection_pool.rb:188:in `checkout'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/connection_adapters/abstract/
connection_pool.rb:184:in `loop'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/connection_adapters/abstract/
connection_pool.rb:184:in `checkout'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/1.8/monitor.rb:242:in
`synchronize'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/connection_adapters/abstract/
connection_pool.rb:183:in `checkout'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/connection_adapters/abstract/
connection_pool.rb:98:in `connection'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/connection_adapters/abstract/
connection_pool.rb:326:in `retrieve_connection'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/connection_adapters/abstract/
connection_specification.rb:123:in `retrieve_connection'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/connection_adapters/abstract/
connection_specification.rb:115:in `connection'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/query_cache.rb:9:in `cache'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/query_cache.rb:28:in `call'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/connection_adapters/abstract/
connection_pool.rb:361:in `call'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in `call'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
rack-1.0.1/lib/rack/head.rb:9:in `call'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
rack-1.0.1/lib/rack/methodoverride.rb:24:in `call'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
actionpack-2.3.5/lib/action_controller/params_parser.rb:15:in `call'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
actionpack-2.3.5/lib/action_controller/session/cookie_store.rb:93:in
`call'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in `call'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
rack-1.0.1/lib/rack/lock.rb:11:in `call'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
rack-1.0.1/lib/rack/lock.rb:11:in `synchronize'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
rack-1.0.1/lib/rack/lock.rb:11:in `call'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
actionpack-2.3.5/lib/action_controller/dispatcher.rb:114:in `call'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
actionpack-2.3.5/lib/action_controller/reloader.rb:34:in `run'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
actionpack-2.3.5/lib/action_controller/dispatcher.rb:108:in `call'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
rails-2.3.5/lib/rails/rack/static.rb:31:in `call'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
rack-1.0.1/lib/rack/urlmap.rb:46:in `call'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
rack-1.0.1/lib/rack/urlmap.rb:40:in `each'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
rack-1.0.1/lib/rack/urlmap.rb:40:in `call'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
rails-2.3.5/lib/rails/rack/log_tailer.rb:17:in `call'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
rack-1.0.1/lib/rack/content_length.rb:13:in `call'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
rack-1.0.1/lib/rack/chunked.rb:15:in `call'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
rack-1.0.1/lib/rack/handler/mongrel.rb:64:in `process'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:159:in `process_client'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:158:in `each'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:158:in `process_client'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in `run'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in `initialize'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in `new'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in `run'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:268:in `initialize'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:268:in `new'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:268:in `run'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
rack-1.0.1/lib/rack/handler/mongrel.rb:34:in `run'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/gems/1.8/gems/
rails-2.3.5/lib/commands/server.rb:111
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:31:in `gem_original_require'
K:/_Utilities/ruby186-26_rc2/ruby/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:31:in `require'
script/server:3

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

Read More…

[Rails] Create links with gsub

by rubyonrailsin 0 comments
Hello,

So I have a text area that displays a products description, in the
products description I would like to be able to create links to other
products through the product's id. Mainly because the url's will
change from time to time and I would hate to have random broken links
on my site. Anyways so far I have this in my helper.

module ProductsHelper
def product_description(product)
product.description.gsub(/<a='''>/, "<a href='test.com'>")
end

and then in my view I have this;

<%= product_description(@product) %>

Now when editing the text area for the products description, I would
like to do something like this;

This is a test <a=12345>Product x</a>

So I would like gsub to be able to get the product id which would be
12345 and then replace that product id with the product.permalink
field that is associated with that product.id. as you can tell I am
totally lost on where to even go from here. any help would be greatly
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.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Read More…

[Rails] Re: Email using ruby on rails

by rubyonrailsin 0 comments
Manish Belsare wrote:
> ActionMailer::Base.server_settings = {
> :address => "smtp.tutorialspoint.com",
> :port => 25,
> :domain => "tutorialspoint.com",
> :authentication => :login,
> :user_name => "username",
> :password => "password",
> }
>
>
> Here in this code what shud be the value of "username" and "password"

I don't know; how do you send email? What are your username and
password? You'll also want to change the address and domain to fit your
needs. If you don't know, ask your IT department, or your ISP, or your
webhost.
--
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.

Read More…

[spree-user] Problem after installing Wordsmith extension in Spree 0.9.4

by rubyonrailsin 0 comments
Hi,

after installing wordsmith extension in spree 0.9.4 I get this error:

NoMethodError (undefined method `add_extension_admin_tab' for
#<Admin::OverviewController:0xb50e8e80>):
vendor/extensions/wordsmith/wordsmith_extension.rb:38:in
`add_wordsmith_tab'
passenger (2.2.11) lib/phusion_passenger/rack/request_handler.rb:
92:in `process_request'
passenger (2.2.11) lib/phusion_passenger/abstract_request_handler.rb:
207:in `main_loop'
passenger (2.2.11) lib/phusion_passenger/railz/
application_spawner.rb:418:in `start_request_handler'
passenger (2.2.11) lib/phusion_passenger/railz/
application_spawner.rb:358:in `handle_spawn_application'
passenger (2.2.11) lib/phusion_passenger/utils.rb:184:in `safe_fork'
passenger (2.2.11) lib/phusion_passenger/railz/
application_spawner.rb:354:in `handle_spawn_application'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in
`__send__'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in
`main_loop'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:196:in
`start_synchronously'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:163:in
`start'
passenger (2.2.11) lib/phusion_passenger/railz/
application_spawner.rb:213:in `start'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:262:in
`spawn_rails_application'
passenger (2.2.11) lib/phusion_passenger/
abstract_server_collection.rb:126:in `lookup_or_add'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:256:in
`spawn_rails_application'
passenger (2.2.11) lib/phusion_passenger/
abstract_server_collection.rb:80:in `synchronize'
passenger (2.2.11) lib/phusion_passenger/
abstract_server_collection.rb:79:in `synchronize'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:255:in
`spawn_rails_application'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:154:in
`spawn_application'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:287:in
`handle_spawn_application'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in
`__send__'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in
`main_loop'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:196:in
`start_synchronously'

What is wrong and how to fix this problem? :(

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

Read More…

Re: [spree-user] Re: Easiest Gateway?

by rubyonrailsin 0 comments
Ok, I checked out Google Checkout and it won't work for me. The
business is not located in the US or UK, meaning I can't get a
merchant account.

I have been able to get a paypal account for website standard
payments, but it turns out that Greg's spree-pp-website-standard
extension has one issue and that is; it is incompatible with Spree
0.9.4 current version that is.

So what can I do? Is it possible to make enough adjustments to Greg's
extension to make it compatible with v 0.9.4 or is my only hope
upgrading to Paypal Pro?

Tsega

On 3/11/10, Tsegaselassie Tadesse <tsegaselassi@gmail.com> wrote:
> Hi,
>
> Sorry to interrupt like this but I have the same need, I need to know
> if I can make any of the following gateways work for me, (listed in
> order of preference)
>
> 1. Paypal Website Standard or
> 2. Google Checkout or
> 3. Paypal Website Pro (I know it is included in spree 0.9.4 )
>
> So which one, like Ben, I need to handle this really quickly so I need
> your help. After this is done maybe I can lend a hand by contribution
> to any one of the above extensions. I may not be a master yet but I am
> sure I can help somehow.
>
> Tsega
>
>
> On 3/11/10, Sean Schofield <sean@railsdog.com> wrote:
>> You need a merchant account (with the bank) plus Authorize.net
>> account. Make sure to sign up for the CIM option which allows for the
>> credit card profiles (you need those behind the scenes.)
>>
>> Then it should just be as simple as plugging in your credentials. I'd
>> encourage to setup a test account and try it yourself if you're
>> worried about switching the client and having it not work out.
>>
>> Sean Schofield
>>
>> -------------------------------------------
>> Rails Dog LLC
>> 2 Wisconsin Circle, Suite 700
>> Chevy Chase, MD 20815
>> voice: (301)560-2000
>> -------------------------------------------
>>
>>
>>
>> On Thu, Mar 11, 2010 at 1:06 PM, Bryan.Taylor <btaylornu@gmail.com>
>> wrote:
>>> So if I decide to go with authorize.net, is it as simple as buying a
>>> certificate or instance from them, and filling the credentials into
>>> Spree? Or do I have to do more extensive configuration? Sorry I'm
>>> so urgent about this, my client just needs her site done this weekend
>>> and is bugging out a little since the Paypal stuff isn't working.
>>>
>>> Thanks again.
>>>
>>> On Mar 10, 4:08 pm, Sean Schofield <s...@railsdog.com> wrote:
>>>> I'd recommend authorize.net. PPE should be working and we're
>>>> launching a client next week with it. When things settle down it will
>>>> be easier for us to double back and find out what the various issues
>>>> people are having and try to address them.
>>>>
>>>> Sean Schofield
>>>>
>>>> -------------------------------------------
>>>> Rails Dog LLC
>>>> 2 Wisconsin Circle, Suite 700
>>>> Chevy Chase, MD 20815
>>>> voice: (301)560-2000
>>>> -------------------------------------------
>>>>
>>>>
>>>>
>>>> On Wed, Mar 10, 2010 at 3:45 PM, Ben Lovell <benjamin.lov...@gmail.com>
>>>> wrote:
>>>> > On 10 March 2010 20:39, Bryan.Taylor <btaylo...@gmail.com> wrote:
>>>> > snip
>>>>
>>>> >> On a side note I figured I ask what is the easiest way to remove an
>>>> >> extension? As per discussion above, I'd like to remove
>>>> >> paypal-express
>>>> >> completely, but I'm not sure what the command is.
>>>>
>>>> >> Thanks.
>>>>
>>>> > You use some form of source control I hope? If so, just revert to the
>>>> > rev
>>>> > before you installed the extension. If not, shame on you ;)
>>>> > Cheers,
>>>> > Ben
>>>>
>>>> > --
>>>> > You received this message because you are subscribed to the Google
>>>> > Groups
>>>> > "Spree" group.
>>>> > To post to this group, send email to spree-user@googlegroups.com.
>>>> > To unsubscribe from this group, send email to
>>>> > spree-user+unsubscribe@googlegroups.com.
>>>> > For more options, visit this group at
>>>> >http://groups.google.com/group/spree-user?hl=en.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups
>>> "Spree" group.
>>> To post to this group, send email to spree-user@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> spree-user+unsubscribe@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/spree-user?hl=en.
>>>
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Spree" group.
>> To post to this group, send email to spree-user@googlegroups.com.
>> To unsubscribe from this group, send email to
>> spree-user+unsubscribe@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/spree-user?hl=en.
>>
>>
>

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

Read More…

[Rails] Re: Problem indexing add Simple Table Inherance

by rubyonrailsin 0 comments
On Mar 11, 4:50 am, John Smith <li...@ruby-forum.com> wrote:
> I have a simple table inherance, with an upper class GeneralElement. A
> class that inherits is Activity:
> class Activity < GeneralElement
> ...
> end
>
> The GeneralElement table is very big (about 2.000.000 rows!). Other
> classes that inherit from GeneralElement return queries very fast, but
> Activity.last is very slow. I have added indexes to id and type, but it
> has no effect. What can I do?

You may want to grab the query that Activity.last is using, and try
running it through 'EXPLAIN' to see what it's looking for. Have you
defined an order (via default_scope, for instance) on Activity? You
might need to have an index on that field together with 'type' to get
right behavior.

--Matt Jones

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

Read More…

Re: [Rails] How to make an array available to all views.

by rubyonrailsin 0 comments
On Fri, Mar 12, 2010 at 2:59 AM, Andy Jeffries <andyjeffries@gmail.com> wrote:
> It's dirty, horrible, bad form, breaks the separation of layers...

I don't know what you mean by dirty, it saves several lines of code
and when looking at the view code it is easier to see what is
happening than to see a variable that has to be hunted for in a filter
somewhere to find out what it is.

It saves 4 lines of code, but breaks one of the principles of MVC layered separation.  I'd say the 4 lines is worth it for keeping the application clean.

But think how many lines of code you are going to have to go edit when you realize that you need to change it.

Did you misunderstand my post?  I was arguing for putting it in a filter rather than in the view (hence saying the 4 lines of before_filter, private, def and end was worth it).

It sounds like - when you start with "But" - that you disagree, but the rest of your post seems to be arguing from the same side as my posts.

Cheers,


Yeah, I thought you were saying that not using a filter saves 4 lines of code, and is therefore cleaner, and thus worth it. Seemed to be a weird position to take, glad it was just a misunderstanding.

--
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.
Read More…

[Rails] Re: Most popular IDEs for Ruby on Rails development

by rubyonrailsin 0 comments
On Friday 12 March 2010, Greg Donald wrote:
> On Fri, Mar 12, 2010 at 10:04 AM, Michael Schuerig
<michael@schuerig.de> wrote:
> >> http://static.destiney.com/emacs_screen_shot.jpg
> >
> > There's one feature I've been missing in Emacs:
> There are only missing features until you add them.
>
> http://www.gnu.org/software/emacs/emacs-lisp-intro/emacs-lisp-intro.h
> tml

Yes, I know. Over the past 10+ years I've made a few feeble attempts,
however, I never fell as much in love with Emacs and elisp programming
to do anything substantial. So, no, this is not really an option for me.

Michael

--
Michael Schuerig
mailto:michael@schuerig.de
http://www.schuerig.de/michael/

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

Read More…

[Rails] Email using ruby on rails

by rubyonrailsin 0 comments
ActionMailer::Base.server_settings = {
:address => "smtp.tutorialspoint.com",
:port => 25,
:domain => "tutorialspoint.com",
:authentication => :login,
:user_name => "username",
:password => "password",
}


Here in this code what shud be the value of "username" and "password"
--
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.

Read More…

[Rails] Mass update of associated models

by rubyonrailsin 0 comments
I am importing historical client data from a CODASYL DBMS into
PostgreSQL via an xml document. I am at the point where I am
implementing the actual inserts/updates using ActiveRecord. In the
new system a Client belongs to a Correspondent.

In previous cases I have had to deal with only one model at a time.
In that circumstance I added a class method called 'load' to the model
class and passed it an array of hashes each containing the model
attribute keys and values. In this case I have to divide the
information in one xml node into two models.

My question is one of approach. Do I create each associated
Correspondent model inside the Client class load method and parse all
the data there? Or, do I have the controller script parse the data
first, divide the data into two streams, and then call two separate
#loads, one on the Correspondent model and one on the Client model?

Thoughts?

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

Read More…

Re: [Rails] Re: Re: Re: Re: Re: `bin_path' for Gem:Module (NoMethodError

by rubyonrailsin 0 comments
On Fri, Mar 12, 2010 at 9:37 AM, Faisal Basha <lists@ruby-forum.com> wrote:

> okay....how do I check the ruby and gem executables exactly...this is
> what I know...
>
> unknown0011248da679:~ faisal$ ruby -v
> ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0]

That's probably the problem right there.

`which ruby` will give you the location of the one currently first in your
path. If it's not the one you want, either change your path or get rid of
the unwanted version.

And as I said, you can use `find` to look for other versions.

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
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.

Read More…

[Rails] Re: Re: Re: Re: Re: `bin_path' for Gem:Module (NoMethodError

by rubyonrailsin 0 comments
Hassan Schroeder wrote:
> On Fri, Mar 12, 2010 at 9:08 AM, Faisal Basha <lists@ruby-forum.com>
> wrote:
>
>> I've checked the paths in both the .bash_login and .bash_profile
>>
>> .bash_login
>> export PATH=$PATH:/usr/local/bin:/usr/local/mysql/bin:$PATH
>
> That's definitely going to create duplicates, which you don't want,
> but the critical thing is to make sure you're using the ruby and gem
> executables you think you are (or at least want to!).
>
> --
> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
> twitter: @hassan

okay....how do I check the ruby and gem executables exactly...this is
what I know...

unknown0011248da679:~ faisal$ ruby -v
ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0]

unknown0011248da679:~ faisal$ gem -v
1.3.6

but I know I have downloaded the ruby 1.8.6...now I dont' exactly know
how to
check the ones that Iam currently using.....the extraneous ones I
mean.....
--
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.

Read More…

[Rails] Re: Amateur's effort to add a new page to his website

by rubyonrailsin 0 comments
This summary is not available. Please click here to view the post.
Read More…

Re: [Rails] Re: Re: Re: Re: `bin_path' for Gem:Module (NoMethodError)

by rubyonrailsin 0 comments
On Fri, Mar 12, 2010 at 9:08 AM, Faisal Basha <lists@ruby-forum.com> wrote:

> I've checked the paths in both the .bash_login and .bash_profile
>
> .bash_login
> export PATH=$PATH:/usr/local/bin:/usr/local/mysql/bin:$PATH

That's definitely going to create duplicates, which you don't want,
but the critical thing is to make sure you're using the ruby and gem
executables you think you are (or at least want to!).

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
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.

Read More…

[Rails] Re: Re: Re: Re: `bin_path' for Gem:Module (NoMethodError)

by rubyonrailsin 0 comments
Hassan Schroeder wrote:
> On Fri, Mar 12, 2010 at 7:44 AM, Faisal Basha <lists@ruby-forum.com>
> wrote:
>
>> unknown0011248da679:~/example faisal$ ruby script/about
>> Rails requires RubyGems >= 1.3.2. Please install RubyGems and try again:
>> http://rubygems.rubyforge.org
>
> Sounds like it's back to a bad path -- somewhere you have more than
> one `gem` command. Make sure your path is free of duplications, and
> the directory with the ruby and gem you want is at the front.
>
> And use `find` to track down the extraneous stuff and get rid of it :-)
>
> --
> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
> twitter: @hassan

Hi Hassan,

I've checked the paths in both the .bash_login and .bash_profile

.bash_login
export PATH=$PATH:/usr/local/bin:/usr/local/mysql/bin:$PATH

.bash_profile
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

On looking at the PATH ...I have "/usr/local/bin" written twice....so
Iam thinkin if I should remove the extra "/usr/local/bin".....???
just wanna make sure...thanks Hassan....

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

Read More…

Re: [Rails] Newbie over here

by rubyonrailsin 0 comments
On 12 March 2010 14:32, woodsy0130 <woodsy0130@hotmail.com> wrote:
> How do you specifiy a relationship between a many to many
> decomposition table?
>
> I have been experiementing with has many through etc but i cant seem
> to get it working...
>
> My tables are student and award and the 'relationship' table is
> 'certificate'.

Have a look at the rails guide on ActiveRecord associations at
http://guides.rubyonrails.org/. It has many examples.

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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Read More…

[Rails] Re: Email section

by rubyonrailsin 0 comments
class UserMailer < ActionMailer::Base
def reminder(user)
@subject = 'Your login information at KnowledgeEngine.com'
@body = {}
#Give body access to the user information.
@body["user"] = user
@recipients = user.email
@from = 'KnowldegeEngine <do-not-reply@knowledgeengine.com>'
end

def message(mail)
subject mail[:message].subject
from 'KnowledgeEngine <do-not-reply@knowledgeengine.com>'
recipients mail[:recipient].email
body mail
end

end

diz is the code for UserMailer..
--
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.

Read More…

Re: [Rails] Amateur's effort to add a new page to his website

by rubyonrailsin 0 comments
This summary is not available. Please click here to view the post.
Read More…

[Rails] Re: Email section

by rubyonrailsin 0 comments
class EmailController < ApplicationController

include ProfileHelper
before_filter :protect, :only => [ "correspond" ]

def remind
@title = "Mail me my login information"
if param_posted?(:user)
email = params[:user][:email]
user = User.find_by_email(email)
if user
UserMailer.deliver_reminder(user)
flash[:notice] = "Login information was sent."
redirect_to :action => "index", :controller => "site"
else
flash[:notice] = "There is no user with that email address."
end
end
end

def email_sent

MyMailer::deliver_mail("recipient.address@example.com")

end

def correspond
user = User.find(session[:user_id])

id=session[:user_id]
Personal.find_each do |@per|
if(@per.user_id == id) # id is user id
@per_id = "#{@per.id}" #que_id is question_id
break
end
end
idd=@per_id
#flash[:notice] = idd
iddd=idd.to_i


recipient = User.find_by_user_name(params[:id])

@title = "Email: #{@per.first_name} #{@per.last_name}
(#{user.user_name}) :: Recipient: #{recipient.user_name}"
if param_posted?(:message)
@message = Message.new(params[:message])
if @message.valid?
UserMailer.deliver_message(
:user => user,
:recipient => recipient,
:message => @message,
:user_url => profile_for(user),
:reply_url => url_for(:action => "correspond",
:id => user.user_name)
)
flash[:notice] = "Email sent."
redirect_to profile_for(recipient)
end
end
end

end


ya diz is the code for email_controller....
Can u please tell me what is the problem that the email is not being
sent?
--
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.

Read More…

Re: [Rails] Most popular IDEs for Ruby on Rails development

by rubyonrailsin 0 comments
I advise using a text editor and command line tools if you are just
learning. An IDE will hide too many important things from you. Plus,
you'll spend time dicking around with the IDE and plugins and just
trying to get it working that you can be spending building your
application or learning Rails and Ruby.

I use Eclipse for Java development. Not because I like it, but because
I've used an IDE my whole Java career and can not do without the
crutch. I've vowed to not restrict myself like that with Ruby and
Groovy.

On Fri, Mar 12, 2010 at 2:24 AM, Krum Bakalsky <kpym.kgb@gmail.com> wrote:
> Hi guys,
>
> Can you tell me which are the most popular and widely used IDEs for
> Ruby, and for Ruby on Rails development ? According to your
> impressions ?
> What do you use the most ? Are there different solutions for the
> different operating systems ?
>
>
> Thanks,
>
> Krum.
>
> --
> 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.
>
>

--
Curtis Cooley
curtis.cooley@gmail.com
home:http://curtiscooley.com
blog:http://ponderingobjectorienteddesign.blogspot.com
===============
Leadership is a potent combination of strategy and character. But if
you must be without one, be without the strategy.
-- H. Norman Schwarzkopf

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

Read More…

Re: [Rails] Re: Most popular IDEs for Ruby on Rails development

by rubyonrailsin 0 comments
On Fri, Mar 12, 2010 at 10:04 AM, Michael Schuerig <michael@schuerig.de> wrote:
>> http://static.destiney.com/emacs_screen_shot.jpg
>
> There's one feature I've been missing in Emacs:

There are only missing features until you add them.

http://www.gnu.org/software/emacs/emacs-lisp-intro/emacs-lisp-intro.html


--
Greg Donald
destiney.com | gregdonald.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.

Read More…

[Rails] Re: we need this (codebubbles)

by rubyonrailsin 0 comments
I saw CodeBubbles on Slashdot yesterday and had the exact same
thought. Now I can't stop thinking about how an interface like that
could make my life so much easier. I'm refactoring a bunch of
controllers with big blocks of nearly identical code. Oh to have the
actions side by side in bubbles.

I saw the discussion of it being based on Eclipse as well. I've never
used Eclipse, or RadRails on top of it. Maybe somebody who has more
familiarity with those projects could take a look?

Les
codebenders.com

On Mar 11, 8:54 am, Julian Leviston <jul...@coretech.net.au> wrote:
> I think something like this would benefit Ruby & Rails development a huge amount. I miss the capacities the Smalltalk (+Self) browsers enabled the facilitation of.
>
> The disadvantage was that it was an "entire closed world" but this is a more open idea... also it seems to integrate with Eclipse, which may mean RadRails would integrate with it. Would this mean we could browse class hierarchies of Ruby and directly execute code, etc?
>
> It'd be fantastic if this was the case. A dream come true.
>
> http://www.cs.brown.edu/people/acb/codebubbles_site.htm
>
> Julian.
>
> ----------------------------------------------http://sensei.zenunit.com/
> New Rails Videos (3-June-09)
> Blog:http://random8.zenunit.com/
> Twitter:http://twitter.com/random8r
> Music:http://itunes.apple.com/au/artist/digital-smartarse/id302021320

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

Read More…

[Rails] Re: Most popular IDEs for Ruby on Rails development

by rubyonrailsin 0 comments
On Friday 12 March 2010, Greg Donald wrote:
> On Fri, Mar 12, 2010 at 4:24 AM, Krum Bakalsky <kpym.kgb@gmail.com>
wrote:
> > Hi guys,
> >
> > Can you tell me which are the most popular and widely used IDEs for
> > Ruby, and for Ruby on Rails development ? According to your
> > impressions ?
> > What do you use the most ? Are there different solutions for the
> > different operating systems ?
>
> http://static.destiney.com/emacs_screen_shot.jpg

There's one feature I've been missing in Emacs: find all files in a
project matching a certain, incrementally typed pattern. And activate
this by a single shortcut. Eclipse/Aptana and Textmate do this
exceptionally well, I haven't found this functionality in a similarly
easy and quick way in Emacs. It might be hidden somewhere, please point
it out in case I just didn't find it.

Michael

--
Michael Schuerig
mailto:michael@schuerig.de
http://www.schuerig.de/michael/

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

Read More…

Re: [Rails] Re: Re: Re: `bin_path' for Gem:Module (NoMethodError)

by rubyonrailsin 0 comments
On Fri, Mar 12, 2010 at 7:44 AM, Faisal Basha <lists@ruby-forum.com> wrote:

> unknown0011248da679:~/example faisal$ ruby script/about
> Rails requires RubyGems >= 1.3.2. Please install RubyGems and try again:
> http://rubygems.rubyforge.org

Sounds like it's back to a bad path -- somewhere you have more than
one `gem` command. Make sure your path is free of duplications, and
the directory with the ruby and gem you want is at the front.

And use `find` to track down the extraneous stuff and get rid of it :-)

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
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.

Read More…

[Rails] Re: Most popular IDEs for Ruby on Rails development

by rubyonrailsin 0 comments
Krum Bakalsky wrote:
> Hi guys,
>
> Can you tell me which are the most popular and widely used IDEs for
> Ruby, and for Ruby on Rails development ? According to your
> impressions ?
> What do you use the most ? Are there different solutions for the
> different operating systems ?

Of all the IDE I've used I hate Netbeans the least. But, note that I
don't use any of them for Ruby development. I basically have to use an
IDE for my Java work to keep myself sane. I just can't bring myself to
say that I "like" any of them though.

As for Ruby and Ruby on Rails, I'm a Textmate users. As far as any
debate on whether Textmate could be categorized as an IDE, I don't
really care. All I know is that I find it to be an excellent text editor
for writing code.

The IDEs that constantly popup suggestions for completion actually
drives me a bit nuts. I know a lot of people love that sort of thing.
However, I want a text editor that helps me edit text, and then gets out
of my way so I can write code. I don't need, or want, it to try to write
code for me.

This is what Textmate does for me. I also know a number of developers
that prefer VIM, but for very similar reasons. I could see the appeal of
being able to stick to one tool (a terminal in this case), but I'm still
a lot more comfortable with a terminal window and a Textmate window.
--
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.

Read More…

Re: [Rails] Most popular IDEs for Ruby on Rails development

by rubyonrailsin 0 comments
On Fri, Mar 12, 2010 at 4:24 AM, Krum Bakalsky <kpym.kgb@gmail.com> wrote:
> Hi guys,
>
> Can you tell me which are the most popular and widely used IDEs for
> Ruby, and for Ruby on Rails development ? According to your
> impressions ?
> What do you use the most ? Are there different solutions for the
> different operating systems ?


http://static.destiney.com/emacs_screen_shot.jpg

--
Greg Donald
destiney.com | gregdonald.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.

Read More…

[Rails] Re: Re: Re: `bin_path' for Gem:Module (NoMethodError)

by rubyonrailsin 0 comments
Hassan Schroeder wrote:
> On Thu, Mar 11, 2010 at 10:18 PM, Faisal Basha <lists@ruby-forum.com>
> wrote:
>
>> unknown0011248da679:~/example faisal$ ruby script/server
>> Rails requires RubyGems >= 1.3.2. Please install RubyGems and try again:
>> http://rubygems.rubyforge.org
>>
>> I don't understand the above warning , since I have rubygems 1.3.6.
>
> What's the output of `script/about` ?
>
> --
> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
> twitter: @hassan

this is what I got....

unknown0011248da679:~/example faisal$ ruby script/about
Rails requires RubyGems >= 1.3.2. Please install RubyGems and try again:
http://rubygems.rubyforge.org
unknown0011248da679:~/example faisal$ script/about
Rails requires RubyGems >= 1.3.2. Please install RubyGems and try again:
http://rubygems.rubyforge.org
--
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.

Read More…

[Rails] When -exactly- does the Rails3 application get initialized?

by rubyonrailsin 0 comments
I've been fighting left and right with rails 3 and bundler. There are
a few gems out there that don't work properly if the rails application
hasn't been loaded yet. factory_girl and shoulda are both examples,
even on the rails3 branch. Taking shoulda as an example, when trying
to run rake test:units I get the following error:
DEPRECATION WARNING: RAILS_ROOT is deprecated! Use Rails.root instead.
(called from autoload_macros at c:/code/test_harness/vendor/
windows_gems/gems/shoulda-2.10.3/lib/shoulda/autoload_macros.rb:40) c:/
code/test_harness/vendor/windows_gems/gems/shoulda-2.10.3/lib/shoulda/
autoload_macros.rb:44:in 'join': can't convert #<Class:0x232b7c0> into
String (TypeError) from c:/code/test_harness/vendor/windows_gems/gems/
shoulda-2.10.3/lib/shoulda/autoload_macros.rb:44:in 'block in
autoload_macros' from c:/code/test_harness/vendor/windows_gems/gems/
shoulda-2.10.3/lib/shoulda/autoload_macros.rb:44:in 'map' from c:/code/
test_harness/vendor/windows_gems/gems/shoulda-2.10.3/lib/shoulda/
autoload_macros.rb:44:in 'autoload_macros' from c:/code/test_harness/
vendor/windows_gems/gems/shoulda-2.10.3/lib/shoulda/rails.rb:17:in
'<top (required)>'

Digging a bit deeper into lib/shoulda/rails, I see this:
root = if defined?(Rails.root) && Rails.root
Rails.root
else
RAILS_ROOT
end
# load in the 3rd party macros from vendorized plugins and gems
Shoulda.autoload_macros root, File.join("vendor", "{plugins,gems}",
"*")

So...what's happening here is while Rails.root is defined, Rails.root
== nil, so RAILS_ROOT is used, and RAILS_ROOT==nil, which is then
being passed on to Shoulda.autoload_macros. Obviously the rails app
has yet to be initialized. With Rails3 using Bundler now, there's been
some hubub over on the Bundler side about being able to specify an
order in which the gems are required, but I'm not sure whether or not
this would solve the problem at hand.
Ultimately my questions is this: When exactly does the environment.rb
file (which actually initializes the application) get pulled in? Is
there any harm to bumping up when the app is initialized and have it
happen before the Bundler.require line in config/application.rb? I've
tried to hack bundler to specify the order myself, and have the rails
gem pulled in first, but it doesn't appear to me that requiring the
rails gem actually initializes the application.
As this line (in config/application.rb) is being called before the app
is initialized, any gem in the bundler Gemfile that requires rails to
be initialized is going to tank.

# Auto-require default libraries and those for the current Rails
environment. Bundler.require :default, Rails.env

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

Read More…

[spree-user] Re: Need A Developer

by rubyonrailsin 0 comments
MIT says maybe not - http://blog.ksplice.com/2010/03/quadruple-productivity-with-an-intern-army/

On Mar 12, 6:20 am, Roman Smirnov <pom...@gmail.com> wrote:
> > project that is near completion.
>
> New developer only worsen the situation with your project. For details
> see "Adrenaline Junkies and Template Zombies" pattern #28 "Time
> Removes Cards From Your Hand"
>
> On Mar 11, 11:29 pm, "Bryan.Taylor" <btaylo...@gmail.com> wrote:
>
>
>
> > Hi,
>
> > I've been working on a Spree site for a client for many months, but I
> > have run into problems with my staffing and with my availability in
> > general.  The site is nearly finished, all that needs to be done is
> > for some static pages to be added, products uploaded, and gateway
> > integrated, all the graphics, skin, logos, etc are done.
>
> > Since I will most likely be dropping this project this weekend, I
> > figured I'd ask around here to see if any devs are available to pick
> > up and wrap up this project that is near completion.  The client is
> > freaking out a bit because of the overall delays we have experienced,
> > so time is of the essence.  If you have experience with Spree and have
> > time to finish up a small project (for pay of course), please send me
> > an email at b...@thinklime.net
>
> > Thanks.

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

Read More…

Re: [Rails] Re: Re: `bin_path' for Gem:Module (NoMethodError)

by rubyonrailsin 0 comments
On Thu, Mar 11, 2010 at 10:18 PM, Faisal Basha <lists@ruby-forum.com> wrote:

> unknown0011248da679:~/example faisal$ ruby script/server
> Rails requires RubyGems >= 1.3.2. Please install RubyGems and try again:
> http://rubygems.rubyforge.org
>
> I don't understand the above warning , since I have rubygems 1.3.6.

What's the output of `script/about` ?

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
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.

Read More…

Re: [Rails] Re: Need example of a drop-down field in Rails 2.3.5

by rubyonrailsin 0 comments
You can also look at collection_select & the rest of the form helpers.

Niels

On Mar 11, 2010, at 11:51 PM, RichardOnRails wrote:

> Hi there,
>
> Premature posting. It just dawned on me to Google for "Rails acts as
> dropdown". That seems very fruitful, so I don't think I need any
> help. Nevertheless, I'll accept any that's offered :-)
>
> Best wishes,
> Richard
>
> On Mar 11, 11:39 pm, RichardOnRails
> <RichardDummyMailbox58...@USComputerGurus.com> wrote:
>> Hi All,
>>
>> I've looked at a few of my Rails 2 books & Google to no avail in the
>> effort to find an example of using a drop-down control. Any
>> suggestions (especially a URL or two)?
>>
>> Thanks in Advance,
>> Richard
>
> --
> 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.

Read More…

[spree-user] Each time cart link is hit an empty order is created

by rubyonrailsin 0 comments
Hi guys,

I encountered a problem that must have been addressed by someone, but
I can't find where. I'm a newbie Spree user.

Each time someone hits the Cart link, an empty order gets created in
the database, which leaves me with hundreds of empty orders a day. I
guess that more logical would be actually creating an order at a
checkout, but I may miss something.

Any thoughts?

Cheers!

Sergei
writelesscode.com

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

Read More…

[Rails] Protecting static assets

by rubyonrailsin 0 comments
How can I protect static assets behind authentication.
I'm familliar with protecting dynamic pages but how to protect static
files?

An example would be : someone login to my application, upload a
picture and authorize only some users to see this picture.
How to avoid someone to access the picture, even if this pperson knows
the correct url of the file.

The solution is probably to let rails handle static files, but how to
force this behavior and how to handle differents file types (probably
through sendfile).

Greetz

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

Read More…

Re: [spree-user] Re: customizing the order mailer confirmation

by rubyonrailsin 0 comments
This should be very straightforward, as order.rb has:

  has_one :bill_address, :through => :checkout
  has_one :ship_address, :through => :checkout

So u can just override the order_mailer template (confirm.html.erb) with something like: 


On 12 March 2010 14:28, jeremy nagel <jeremymnagel@gmail.com> wrote:
I'd like to know this too.

On Mar 5, 6:16 am, ravenna <t...@ravennainteractive.com> wrote:
> I need to add the billing and shipping addresses  to the Order
> Confirmation Mailer.  But the addresses belong to the checkout, is it
> possible?
>
> thanks

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




--
Brian Quinn

-------------------------------------------
Rails Dog LLC
2 Wisconsin Circle, Suite 700
Chevy Chase, MD 20815
voice: (301)560-2000
-------------------------------------------

--
You received this message because you are subscribed to the Google Groups "Spree" group.
To post to this group, send email to spree-user@googlegroups.com.
To unsubscribe from this group, send email to spree-user+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.
Read More…

Re: [spree-user] Re: Help with creating new gateway

by rubyonrailsin 0 comments
There's a couple of things you need:

1 - Is the gateway you want currently supported by ActiveMerchant? - if not you'll need to create a patch / override for that.

2 - You need to create a wrapper in Spree to wrap around the ActiveMerchant gateway, take a look at http://github.com/goodkarma/spree-braintree for an example of how to that.



On 12 March 2010 14:25, jeremy nagel <jeremymnagel@gmail.com> wrote:
BUMP

Can someone please explain to me how I add my gateway to the list in
the spree admin panel? It is far from self explanatory:(

On Mar 8, 6:22 pm, jeremy nagel <jeremymna...@gmail.com> wrote:
> Hi,
> I'm trying to create a new gateway for a bank in Australia that
> performs credit card processing. I've come up against a stumbling
> block: in order to 'capture' the credit card transaction, the bank
> wants the credit card details again as well as the pre-auth ID. Is
> there any way to achieve this?
>
> I'm using Spree Edge and am also finding it a little bit tricky to
> understand how to add my gateway to the list in the payment methods
> admin screen. It seems to be hard-coded in but when I added my class
> to the list in the gateways file, it still didn't appear on the admin
> screen.

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




--
Brian Quinn

-------------------------------------------
Rails Dog LLC
2 Wisconsin Circle, Suite 700
Chevy Chase, MD 20815
voice: (301)560-2000
-------------------------------------------

--
You received this message because you are subscribed to the Google Groups "Spree" group.
To post to this group, send email to spree-user@googlegroups.com.
To unsubscribe from this group, send email to spree-user+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.
Read More…

[Rails] Newbie over here

by rubyonrailsin 0 comments
How do you specifiy a relationship between a many to many
decomposition table?

I have been experiementing with has many through etc but i cant seem
to get it working...

My tables are student and award and the 'relationship' table is
'certificate'.

Thanks for any responses

Dale

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

Read More…

Subscribe feeds via e-mail

Blog Archive