obviously :D
I was just thinking that could reuse configuration in your database.yml (for
credentials, database location, etc)
On Tuesday, February 8, 2011 8:51:32 AM UTC+2, jim wrote:
>
> no rake task needed. if you have the mysqldump, use the following (assuming
> the dump is dump.sql)
>
> mys
Cool :)
Good to hear.
In perl, we used to pass the id of objects we want to methods (ie. search)
and have a result given back. I know these days, we pass objects instead of
primary ids which is cool :)
Cheers:D
Gordon Yeong
On 8 February 2011 17:41, Jim Ruther Nill wrote:
> Congratulations on
use
match "products/category/:id/:name" => "products#index"
the :as argument is for named_routes. if you want a named_route you can
instead use
match "products/category/:id/:name" => "products#index", :as =>
:product_category
then in your views, you can use the named route
product_category
On Tue, Dec 28, 2010 at 10:44 PM, dare ruby wrote:
> Dear Friends,
>
> Am in process of building a video player rails application, which is
> compatabile to Safari, ipad, iphone device.
>
> I have used below code to render a video and it works fine in safari.
> But videos are not played in ipad a
Hi all
My problem is simple :
I have a link which points on :
"products/category/#{category.id}/#{category.name}"
In my route, I'd like this link calls "products/index" BUT I want this
URL in the browser : "products/category/#{name}"
Using Rails 3 I instinctively tried :
match "products/categ
no rake task needed. if you have the mysqldump, use the following (assuming
the dump is dump.sql)
mysql -u root -p database < dump.sql
On Tue, Feb 8, 2011 at 2:03 PM, Nikos Dimitrakopoulos wrote:
> How do you do it? Regular sql dump tool (like mysqldump) and then some rake
> task for importing i
Most of the time, I don't use habtm because I want complete control on the
middle model.
So if you're following Hendra's models, to search for a book under a
category
>> cat = ['Java', 'Python']
>> books = Book.where(:categories => {:name =>
cat}).includes(:categories).all
This is assuming that a
Congratulations on solving your problem. However, I just want to clarify one
thing regarding named routes.
(Just to help users reading the thread)
What Hendra said isn't wrong. You can pass anything to part_url and it will
be passed to the controller as
params[:id]. To make our codes easier to r
> Email me if you haven't solved it and would like more help.
>
> Ben
Ben , didnt get the issue fixed
When i try in ruby console like this,
irb(main):001:0> MIME::Types.type_for("videos/big_buck_bunny.mp4").to_s
=> "video/vnd.objectvideo"
Its not returning mp4 format, will that affect the a
Frederick Cheung wrote in post #980025:
> On Feb 7, 8:17am, Mohnish G j wrote:
>> [POST]
>> 'defg8', 'abcd8', '2011-02-07 13:39:33', NULL)
>> SQL (0.001896) COMMIT
>> Redirected tohttp://localhost:3000/books/1054583410
>> Completed in 0.01805 (55 reqs/sec) | DB: 0.00376 (20%) | 302 Found
>> [htt
This *may* be
useful http://blog.nikosd.com/2008/09/ruby-rails-jobs-in-europe-usa-and.html
(although it's 2 years old with some updates)
On Tuesday, February 8, 2011 12:26:47 AM UTC+2, Ruby-Forum.com User wrote:
>
> Hi, I am wondering if you guys know of any good places to post a job for
> Ruby
How do you do it? Regular sql dump tool (like mysqldump) and then some rake
task for importing it on the development database?
On Tuesday, February 8, 2011 1:42:22 AM UTC+2, paul wrote:
>
> Do you have your app deployed? What I do is populate development with
> a recent backup of my live server e
Hi,
By attachment_fu i stored pdf file...now i want to view it through view
file ,can anybody help me
--
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
I think the best way to implement HABTM is using midle model, it will useful
for your query performance
Example
Model Book
has_many :book_category_relations
has_many :categories, :through => :book_category_relation
end
Model Category
has_many :book_category_relations
has_many :books,
hi, all,
I figured out why.
I was updating my source codes and i actually put another call for
parts_url in my notification_mailer.rb under the model subdirectory.
Lesson of the day - never call *_url within your model especially when
the object does not belong to the class where the model is b
maybe you can try this:
part_url(@part.id)
On Tue, Feb 8, 2011 at 8:19 AM, ct9a wrote:
> hi all,
>
>
> in my application, I am trying to send out a notification to users.
>
> I can call part_url(@part) from the calling method in the controller
> BUT when I try to put the value of the parts_url
Thanks, i used sunspot instead of solar
>
--
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+unsubscr
Thanks, i usen sunspot instead of solar
--
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+unsubscr..
hi all,
in my application, I am trying to send out a notification to users.
I can call part_url(@part) from the calling method in the controller
BUT when I try to put the value of the parts_url into a notification
object, it fails.
Here's the message:
ActionController::RoutingError (part_url
Do you have your app deployed? What I do is populate development with
a recent backup of my live server every once in a while. That way I'm
seeing what the users are (at least until it drifts).
On Mon, Feb 7, 2011 at 5:51 PM, Hesham wrote:
> What would be the best way to populate a development da
Can you point a browser to http://127.0.0.1:8982/solr ? Normally solr
is set up at 8983, do you have a typo there? Also, if you are just
starting with solr, I'd recommend the rsolr gem instead. It is
actively being maintained.
On Mon, Feb 7, 2011 at 3:52 PM, Hassan Schroeder
wrote:
> On Sun, Feb
found the problem :)
had to change WebsiteUser's has_many :marks to include :foreign_key =>
author_id
class WebsiteUser < ActiveRecord::Base
has_many :marks, :foreign_key => :author_id
has_many :videos_marked, :through => :marks, :source
=> :markable, :source_type => "Video", :class_name => "
What would be the best way to populate a development database for a
Rails 3 app? I have looked at faker, but it seems that development has
stopped, any other options?
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group,
> Hi, I am wondering if you guys know of any good places to post a job for
> Ruby on Rails developers? Which job boards do most people use? Our
jobs.rubynow.com
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, sen
Hi, I am wondering if you guys know of any good places to post a job for
Ruby on Rails developers? Which job boards do most people use? Our
current posting is at:
http://jobs.github.com/companies/Digital%20Waybill
--
Posted via http://www.ruby-forum.com/.
--
You received this message because y
Colin Law wrote in post #980132:
> On 7 February 2011 21:06, James Byrne wrote:
>> puts( current_log_entry.class )
>> puts( hash[:current_batch][:tx_batch_mtime] )
>>
>> current_log_entry.tx_batch_mtime = \ # linebreak for clarity
>
> The \ must be the last char on the line, though I would have
On 7 February 2011 21:35, Matias Fierro wrote:
> I want to trigger a callback after the creation of an object. With a
> after_create I have the problem that if the record crash for any
> reason when save, then I have some corrupt data. So I need a callback
> after_save but only when the record is
I want to trigger a callback after the creation of an object. With a
after_create I have the problem that if the record crash for any
reason when save, then I have some corrupt data. So I need a callback
after_save but only when the record is new.
--
You received this message because you are subs
On 7 February 2011 21:06, James Byrne wrote:
> Q. What am I doing wrong such that tx_batch_mtime is not receiving the
> value I believe that I am assigning? At this point current_entry has
> not itself been saved.
>
> I have this code:
>
> puts( "*** ***" *3 )
>
> current_log_entry = c
Q. What am I doing wrong such that tx_batch_mtime is not receiving the
value I believe that I am assigning? At this point current_entry has
not itself been saved.
I have this code:
puts( "*** ***" *3 )
current_log_entry = current_entry.edi_log_entries.build
puts( current_log_entry.
On Sun, Feb 6, 2011 at 9:32 PM, loganathan sellappa
wrote:
> Requiring REXML
> Clearing index for Resume...
> rake aborted!
> Couldn't connect to the Solr server at http://127.0.0.1:8982/solr. undefined
> method `closed?' for nil:NilClass,
You need to run this with --trace and look at the stack
On Feb 5, 10:29 am, Mike wrote:
> Hi,
>
> I have an interesting dilemma, which is best shown through example.
> Say I have Car and Part models which have a HABTM association. In
> this case though, the Part class is an STL with Wheel and
> SteeringWheel as models. Is there a way to setup the C
I have a Contact model that is a non activerecord model. I can use the
validation thanks to Rails3, but I do not in which section of
en.yml/de.yml I should localize the attributes of my Contact model.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscri
Do you prefer attr_protected or attr_accessible?
I used to only use attr_accessible, but usually my model only has one
field to be protected, so it becomes a pain to write:
object.attr1 = ...
object.attr2 = ...
etc
I am considering the use of attr_protected with tests to make sure that
the pro
On 7 Feb 2011, at 17:32, Amador Antonio Cuenca wrote:
> Hi all, I've the following doubt.
>
>
> <% if @entry.geomatics_checker_id.nil? and current_user.geomatics %>
> <%= link_to @entry, :confirm => 'Are you sure?', :method =>
> :set_reviewer do %>
Method (in this context) refers
Ok Let's try:
I want to update a especific field from a show view when I click the "Set
reviewer" link (assigning the current user ID), reload the same view and see
the changes.
Fields:
*Entry.geomatics_checker_id
*User.id.
I hope you can upderstand now. (Sorry for my bad english :/ )
Regards,
On 7 February 2011 17:32, Amador Antonio Cuenca wrote:
> Hi all, I've the following doubt.
> I've this controller methods:
> def set_elaborator
> @entry = Entry.find(params[:id])
> @entry.geomatics_elaboration_id = current_user.id
> if @entry.save!
This should be save, not save!. s
Hi all, I've the following doubt.
I've this controller methods:
def set_elaborator
@entry = Entry.find(params[:id])
@entry.geomatics_elaboration_id = current_user.id
if @entry.save!
redirect_to(@entry, :notice => 'Elaborator setted successfully')
end
end
def set_review
Sasikala P wrote in post #979753:
> Hi All,
>
> I am displaying delicious feeds in my website. I am getting response
> in json file from the delicious site. I cannot parse the response, I
> am getting :406 not acceptable" error in the log file. Any help would
> be much appreciated.
In order to hel
My bad I just realized that they switched from camelCase css naming to
underscores.
I think Rails 3 introduced too many insignificant changes that are a
pain in the butt to track.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google
I have a problem with my bogus fields no longer highlighted by
fieldWithErrors.
In the railscasts video it works, but not on my app that I am currently
upgrading from 2.x to 3.0. In railscasts Ryan doesn't have to test
manually if the field has an error.
Anyone run into this issue?
--
Posted
Consider the following scenario:
Book has_and_belong_to_many Category.
In other words, a category may have a lot of books, and a book can
have more than one category.
What is the best practice to query all books related to some specified
categories.
For example, if I have following books
"From J
On 7 February 2011 15:50, Kelly Pfaff wrote:
> K thanks for the responses, i will do some reading on params. Didn't
> know changing the value of an instance variable is this complicated.
It isn't complicated, most things seem complicated till you know how
and have had a bit of practice :)
Colin
K thanks for the responses, i will do some reading on params. Didn't
know changing the value of an instance variable is this complicated.
--
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
>From that url:
http://nuclearsquid.com/writings/ruby-1-9-what-s-new-what-s-changed.html
"Ruby 1.9 can now properly read source code files encoded in formats
other than ASCII, as long as you declare it:
# coding: utf-8"
Don't tell me I have to put that in every file of my apps?
--
Posted vi
On 7 February 2011 14:51, Kelly Pfaff wrote:
> Frederick Cheung wrote in post #980057:
>
>>
>> You haven't shown anywhere where you're trying to set it - if you want
>> it to be set based on a parameter, you're going to have to set @grp to
>> params[:something]
>>
>
> Hm, i forgot the on_click in
Frederick Cheung wrote in post #980057:
>
> You haven't shown anywhere where you're trying to set it - if you want
> it to be set based on a parameter, you're going to have to set @grp to
> params[:something]
>
Hm, i forgot the on_click in my code:
<%= link_to image_tag("oranje.png", :mouseover =
I see this:
$ ruby -e 'puts Encoding.find("locale")'
ASCII-8BIT
How to set the proper locale/encoding?
--
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 ruby
Frederick Cheung wrote in post #980055:
> On Feb 7, 12:54pm, Paul Bergstrom wrote:
>> I can't start my app and I suspect permissions and ownership. What
>> permissions should a Rails App have? Can I set 755 on everything or
>> should it be less on some files?
>>
> As long as the user running the a
PALMINFACE
Forgot to add has_many :notes in my user model.
On Feb 7, 5:11 pm, Hesham wrote:
> I have the following in my routes file:
>
> resources :users, :path => 'ronin' do
> resources :notes, :path => 'moras'
> resources :collections, :path => 'haiku'
> end
>
> If use user.col
Hi Jay,
Rates are not a problem for Right Candidate. Our Client which is in
Mobile Domain, looking for Candidates who have good knowledge of ruby
on Rails. It is onsite project.
Job Location:- Boston, MA , USA
Please mail me at - recruit...@quantronix.com or call me 2037182011
On Feb 4, 8:35 pm
On Feb 7, 2:19 pm, Kelly Pfaff wrote:
> I have an instance variable @grp:
> (app\controllers\zwemmers_controller.rb)
> class ZwemmersController < ApplicationController
> ...
> def initialize
> @grp='or1r2r3r4gggrp'
> end
In general I'd be wary of overriding initialize without calling su
On Feb 7, 12:54 pm, Paul Bergstrom wrote:
> I can't start my app and I suspect permissions and ownership. What
> permissions should a Rails App have? Can I set 755 on everything or
> should it be less on some files?
>
As long as the user running the app can read everything in there, and
has writ
I have an instance variable @grp:
(app\controllers\zwemmers_controller.rb)
class ZwemmersController < ApplicationController
...
def initialize
@grp='or1r2r3r4gggrp'
end
attr_accessor :grp
...
end
When i click an image, i reload the main index page and try to change
the value of the varia
Fernando Perez wrote in post #923012:
>
>> When I try to use multibyte characters in my rails controller I get an
>> invalid multibyte characters error
>> (/app/controllers/admin_controller.rb:6: invalid multibyte
>> char (US-ASCII)).
>>
>>
>> After I start the WEBrick server and go to
>> http://lo
With Rails3, it is no longer possible (well soon to be deprecated) to
do:
$ RAILS_ENV=test rake db:migrate
So what's the new way of doing it?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To
I have the following in my routes file:
resources :users, :path => 'ronin' do
resources :notes, :path => 'moras'
resources :collections, :path => 'haiku'
end
If use user.collections I get all the collections owned by the user.
How ever if use user.notes I get
NoMethodError: undef
I can't start my app and I suspect permissions and ownership. What
permissions should a Rails App have? Can I set 755 on everything or
should it be less on some files?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
o
On Feb 7, 9:42 am, Viren Negi wrote:
> So ..
> Is there a way can I Mix the "ActiveRecord::Base" method in "Array" of
> superclass "Object" so that hence forth the object is suitable for any
> further SQL related task
Rather than calling find :all, see if you can use a named_scope (or
just pla
On Feb 7, 8:17 am, Mohnish G j wrote:
> Hi Fred,
>
> I am really sorry for replying late..
>
> In the parameters wrt the development.log for books doesn't consider
> publishing_date to be as part of books.
>
> Have a look at this:
>
> Processing BooksController#create (for 127.0.0.1 at 2011-02-0
I want to send user id as a parameter in my facebook app and want to
return the same to keep track of the user who's connected to facebook
from my app. I'm using Oauth2 methods - authorize_url and
get_access_token. I tried to add parameter here but didn't work. If
anyone has any idea, please share.
Hi Dan ... sorry for the late reply.
> I've gone through this same headache. I too wanted to use a helper
> but couldn't. Have you considered using content_for in view and then
> reference it in the section of the layout to generate the
> javascript?
Considered yes, but decided against as I wo
Hello,
Most of You might find this very weird
but I have no way out of it
I have a method that return a Array Object
the method goes like this in User Model
def accessible_websites
if self.is_super_admin?
## if Super Admin Display all Website
Website.all
elsif self.is_ad
Ok, so I've discovered that user.topics.build can be done in the User
edit form (in my project, not in the gem). However, I'm not sure how to
save this newly built topic; normally this would be done by the topic
controller catching the POST right? But in this case it's not the topic
controller
I think you nailed it Fred. Restarting the app with cache_classes on
fixed the error.
Both the Account and Node models are simple classes though, so I'm not
sure where the reloading is becoming a problem.
Why wouldn't simply restarting the server with cache_classes off fix
something like this
Thanks for the advice, follow up questions:
I'm using Devise for authentication. I think this means the controller
inside the Devise gem handles user model editing.
So, how does one add Topics as a nested resource for Users? I understand
this normally requires three things: a) nested partial fo
Hi Fred,
I am really sorry for replying late..
In the parameters wrt the development.log for books doesn't consider
publishing_date to be as part of books.
Have a look at this:
Processing BooksController#create (for 127.0.0.1 at 2011-02-07 13:39:33)
[POST]
Session ID:
BAh7BzoMY3NyZl9pZCIlZWI5
67 matches
Mail list logo