Hey Anshu,
Taking a look at the code you posted, I don't know for sure why it
would be repeating every so often, but you could try adding a unique
index on the categories table to force the database to break when a
duplicate is inserted. Obviously you might not want to do this with
production
Hi,
I'm trying to implement dehumanize method in Rails 3. Basically what
this post does:
http://rubyglasses.blogspot.com/2009/04/dehumanizing-rails.html
Here:
module ActiveSupport::Inflector
# does the opposite of humanize mostly. Basically does a
# space-substituting .underscore
def
On 23 February 2011 08:20, comopasta Gr li...@ruby-forum.com wrote:
# Add new inflection rules using the following format
ActiveSupport::Inflector.inflections do |inflect|
inflect.plural /^(ox)$/i, '\1en'
end
But if change that to inflect.pluralo /^(ox)$/i, '\1en'
It will complain
plural
Hey,
I think you're just looking for a simple database of known currency
labels. I don't know of anything off the top of my head, but if you
check out Bloomberg's currency conversion system:
http://www.bloomberg.com/markets/currencies/
You can view source and probably rip out the currency
Hi Phoenix Rising,
Thanks for looking at my issue. I have UTF encoding for my databases and
also
for the rails app.
My hunch is that it got to do something with category table having
parent_id for acts_as_tree plugin requirement. Every time, I add a
children of root category
the root category
On Wed, Feb 23, 2011 at 2:54 PM, Butu but...@gmail.com wrote:
Thanks Bryan for your reply.
For first part of my problem, I am able to figure out the nested attributes
with belongs_to.
For second part, I am looking for Rails way solution to my problem.
Using nested attribute. I can able to
Michael Pavling wrote in post #983295:
On 23 February 2011 08:20, comopasta Gr li...@ruby-forum.com wrote:
# Add new inflection rules using the following format
ActiveSupport::Inflector.inflections do |inflect|
inflect.plural /^(ox)$/i, '\1en'
end
But if change that to inflect.pluralo
class Category ActiveRecord::Base
belongs_to :sector
has_and_belongs_to_many :suppliers
validates :sector, :name, :presence = true
As you see I have validates :sector, :presence = true.
When I create a new Category, if I don't select a sector I have an
error page with the message:
Couldn't
Hello all,
I was wondering if anyone would be willing to help me with a project
I'm working on for my graduate studies in software engineering. I'm
currently working on a project involving Ruby on Rails and am
*currently* looking for any published research that highlight the
benefits (e.g.
I'm trying to dynamically set my Paperclip processors which are stored
in my database, ideally I would want to access
attachment.instance.paperclip_processor, but I can't seem to do that.
Any ideas?
# class Post ActiveRecord::Base
has_attached_file :image,
:path = :rails_root/
On Wed, Feb 23, 2011 at 5:37 PM, Mauro mrsan...@gmail.com wrote:
class Category ActiveRecord::Base
belongs_to :sector
has_and_belongs_to_many :suppliers
validates :sector, :name, :presence = true
As you see I have validates :sector, :presence = true.
When I create a new Category, if I
On 23 February 2011 09:16, Phoenix Rising polarisris...@gmail.com wrote:
Hey,
I think you're just looking for a simple database of known currency
labels. I don't know of anything off the top of my head, but if you
check out Bloomberg's currency conversion system:
Hi,
First off thank you both for your replies and apologies for the delayed
reply.
@Fred: I don't know about passenger/ multiple mongrel instances yet and
will look that up. I will also explore Rails:Cache and see what I can
come up.
@Chris: I was going to do some cron jobs which send
I dont think this is possible, at least in germany one city can have more
than one postal code. To get the postal code in this cases you need to have
the street and housenumber to get the right code. I could imagine that it is
the same in other countries
Top posted from android
Am 19.02.2011
On 23 February 2011 09:37, Mauro mrsan...@gmail.com wrote:
class Category ActiveRecord::Base
belongs_to :sector
has_and_belongs_to_many :suppliers
validates :sector, :name, :presence = true
As you see I have validates :sector, :presence = true.
When I create a new Category, if I don't
You have not mentioned any details about the meeting, when is the project
going to start, do you want someone who is a UK citizen or not.
Some details would be appreciated.
On Fri, Feb 4, 2011 at 1:23 PM, Ed cs edcokest...@googlemail.com wrote:
I am looking for a full time developer/coder for
On 23 February 2011 11:43, Colin Law clan...@googlemail.com wrote:
On 23 February 2011 09:37, Mauro mrsan...@gmail.com wrote:
class Category ActiveRecord::Base
belongs_to :sector
has_and_belongs_to_many :suppliers
validates :sector, :name, :presence = true
As you see I have validates
On Tue, Feb 22, 2011 at 8:33 PM, Niklas Nson niklasn...@meantime.se wrote:
I moved the file to /views/javascripts/getlocation.js.erb
But there must be something wrong with routes or something else
still.
If i go to: http://localhost:3000/javascripts/getlocation.js i get a
No route matches
Does not match :controller(/:action(/:id(.:format))) do the
routing ?
I thought it should look in controller and if not found look in public/
javascript ?
//Niklas
On 23 Feb, 14:05, Hassan Schroeder hassan.schroe...@gmail.com wrote:
On Tue, Feb 22, 2011 at 8:33 PM, Niklas Nson
On Wed, Feb 23, 2011 at 5:17 AM, Niklas Nson niklasn...@meantime.se wrote:
Does not match :controller(/:action(/:id(.:format))) do the routing ?
Only if that pattern matches your request - which it doesn't.
No route matches /javascripts/getlocation.js error.
I see a controller, an action,
Using the users system to store that information will not gain you anything.
Maintaining that each time a user makes a request to your server would be a
maintenance nightmare. You would be better off looking into Rails caching on
the server side for speed.
B.
Sent from my iPhone
On Feb 23,
On Feb 23, 2011, at 6:43 AM, Norbert Melzer wrote:
I dont think this is possible, at least in germany one city can have
more than one postal code. To get the postal code in this cases you
need to have the street and housenumber to get the right code. I
could imagine that it is the same in
Hassan, you are my hero Thank you for taking time ... Got it
working :)
/Niklas
On 23 Feb, 14:25, Hassan Schroeder hassan.schroe...@gmail.com wrote:
On Wed, Feb 23, 2011 at 5:17 AM, Niklas Nson niklasn...@meantime.se wrote:
Does not match :controller(/:action(/:id(.:format))) do the
On Feb 23, 2011, at 3:16 AM, Phoenix Rising wrote:
To re-iterate Robert's point above, if it's the conversion you're
looking to do, I'd really recommend looking at a subscription-based
web service that your application can talk to in order to perform
the conversions, because global currency
Thank you, shall have a look at it.
On Wed, Feb 23, 2011 at 7:05 PM, Bryan Crossland bacrossl...@gmail.comwrote:
Using the users system to store that information will not gain you
anything. Maintaining that each time a user makes a request to your server
would be a maintenance nightmare. You
On 23 February 2011 14:31, Bhasker Harihara harihara.bhas...@gmail.com wrote:
Thank you, shall have a look at it.
But don't bother about trying to optimise performance until it is all
working and you know that there is a performance issue. It is very
rare for the bottlenecks to end up being
Hi,
My form_for is loading properly and also storing in the db.
My show user is also fine.
I just want to do a puts user name is #{user.name} this gives me
NoMethodError in UsersController#new
When I use self.name it give the same error
but when I do the same at the console, it works fine.
On Wed, Feb 23, 2011 at 8:43 AM, Norbert Melzer
timmel...@googlemail.com wrote:
I dont think this is possible, at least in germany one city can have more
than one postal code. To get the postal code in this cases you need to have
the street and housenumber to get the right code. I could imagine
At the top of your controller, you'll want to add
helper_method :current_user
Thanks for response, but I place this in application controller:
helper_method :current_user
private
def require_login
unless logged_in?
flash[:error] = You must be logged in to access this section
On 23 February 2011 15:03, Bhasker Harihara harihara.bhas...@gmail.com wrote:
Hi,
My form_for is loading properly and also storing in the db.
My show user is also fine.
I just want to do a puts user name is #{user.name} this gives me
NoMethodError in UsersController#new
When I use
This is what I have and it gives the error.
validates :uname, :presence = true,
:length = { :maximum = 50 }
puts The name is set to #{user.uname}
But without the puts it updates the record into the databse. I think it is
to do with scoping. If have this puts after
On Feb 23, 2011, at 11:03 AM, Bhasker Harihara wrote:
This is what I have and it gives the error.
validates :uname, :presence = true,
:length = { :maximum = 50 }
puts The name is set to #{user.uname}
But without the puts it updates the record into the databse. I
Yeah, I have tried both of them and even :name. Unfortunately the ans is
no.
How does validates work then ?
Regards,
On Wed, Feb 23, 2011 at 9:54 PM, Walter Lee Davis wa...@wdstudio.comwrote:
On Feb 23, 2011, at 11:03 AM, Bhasker Harihara wrote:
This is what I have and it gives the
Let's say I have 5 flv files that I want to play in a browser one after
another.
Is it possible to do this without user intervention?
Is there a Jquery event that I could use to trigger the next flv to
play?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you
I am still unable to understand where is the current_user working and where
not?
It appears like you are using nifty:authentication for authentication,
post the controller method, mention the scope where it is, where are you
using the helper, etc etc. and then we could help you in a better way.
Due to slightly different Gems on the development and the production machines,
I've discovered that Rails 2.3.11 has I18N support in ActiveSupport. Any
recommendations on whether to use the i18n gem (currently using 0.5.0) or the
I18N support in ActiveSupport (apparently 0.4.1)?
TIA,
Jeffrey
Here are the basic instructions I was given from my teacher to complete
a website...
Create a web page (.html.erb extension) that displays the following:
Current time and date obtained from the Time object.
An image of the sun if the time is between 6:00am and 6:00pm. An image
of the moon if
On Wed, Feb 23, 2011 at 4:29 PM, Ralph Shnelvar li...@ruby-forum.comwrote:
Let's say I have 5 flv files that I want to play in a browser one after
another.
Is it possible to do this without user intervention?
Is there a Jquery event that I could use to trigger the next flv to
play?
Where
On 23 February 2011 16:03, Bhasker Harihara harihara.bhas...@gmail.com wrote:
Please don't top post, it makes it difficult to follow the thread.
Insert your reply at appropriate points in previous post. Thanks
This is what I have and it gives the error.
validates :uname, :presence = true,
Boa tarde pessoal.
Estou utilizando o intant rails com ruby v.1.8.6 e rails 2.0.2 com um
servidor sqlserver2000, minha base de dados usa o collation
SQL_latin1_general_CP1_CI_AS, quando tragos strings com acentuação e
cedilha não consigo visualizar os carateres corretos, sei que para
exibir
Hi,
I have a question about single table inheritance and controllers. Lets
start to talk about my domain. There are two parent models in my
system, they and their children are;
class Vehicle ActiveRecord::Base
attr_accessible :name, :model, :engine, :fuel_type .
On Feb 23, 2011, at 11:45 AM, Jatin kumar wrote:
Is it possible to do this without user intervention?
Is there a Jquery event that I could use to trigger the next flv to
play?
Where do you call let's say Video1.play method, is it a jQuery call
or a Rails call?
What are you using to play
On Wed, Feb 23, 2011 at 4:37 PM, Dariusz S. li...@ruby-forum.com wrote:
Here are the basic instructions I was given from my teacher to complete
a website...
Create a web page (.html.erb extension) that displays the following:
Current time and date obtained from the Time object.
An image
I have a problem while updating a 3 keys join table. I've been on this
for quite a while now and have no idea how to fix it. In short, to be
able to get the new project working, I had to set these two habtm
declaration (in /models/project.rb):
has_and_belongs_to_many :users,
Anybody know how to hook Fusemail to ActionMailer? I'm moving from
GoDaddy where I had mailer set up just fine to Fusemail. After googling
around, it appears the impasse is that Fusemail's TLS is an older TLS on
connect...
--
Posted via http://www.ruby-forum.com/.
--
You received this
So what does that mean? How do I fix it?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group,
In my app i have word model, words_controller and want create new
action for word model.
I create new method 'test' in words_controller, and adds:
resources :words do
member do
put 'test'
end
end
in routes.rb
my rake routes output:
test_word PUT/words/:id/test(.:format)
So what does that mean? How do I fix it?
It means we don't know until we see the error message you are getting.
Please post the error message.
--
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
Hello Jim,
Thanks for your reply.
I can able to do accepts_nested_attributes with belongs_to
@song.build_movie
use this either in action or before the form and use fields_for. This will
create the new movie record and insert movie_id in song model as well.
On Wed, Feb 23, 2011 at 2:12 PM,
Peço desculpas pelo meu Português. Estou usando o Google Translate. :-)
Você precisa informar o arquivo database.yml que pretende conversar
com o banco de dados em UTF-8. Para fazer isso adicione encoding: utf8
para o seu banco de dados no database.yml. Deixe-me saber como isso
vai.
Obrigado,
B.
On Wed, Feb 23, 2011 at 6:09 PM, Aegorov Egorov li...@ruby-forum.comwrote:
In my app i have word model, words_controller and want create new
action for word model.
I create new method 'test' in words_controller, and adds:
resources :words do
member do
put 'test'
end
end
in
On Wed, Feb 23, 2011 at 6:06 PM, Dariusz S. li...@ruby-forum.com wrote:
So what does that mean? How do I fix it?
Post the error first. I said it was a guess, I am no GOD
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google
Ok I've packed (not frozen) my app using bundler, and here is what I've done
on the server:
1. Created a directory to upload my files to.
2. Using a web interface I managed to create a symlink to my application
directory
Now what should I do next?
Thanks,
Tsega
--
You received this message
Bryan Crossland wrote in post #983396:
So what does that mean? How do I fix it?
It means we don't know until we see the error message you are getting.
Please post the error message.
I realize I may be crossing a line here by providing too much
assistance, but I'm going to do it anyway just
On Wed, Feb 23, 2011 at 12:09 PM, Aegorov Egorov li...@ruby-forum.comwrote:
In my app i have word model, words_controller and want create new
action for word model.
I create new method 'test' in words_controller, and adds:
resources :words do
member do
put 'test'
end
end
in
Folks,
I am looking around for the best way to add discussion forums to my
application. The application will be used by couple schools each of
which has many grades and each grade can have many sections and each
of the sections needs a forum of its own.
School---has_many grades
2011/2/23 Bryan Crossland bacrossl...@gmail.com:
Peço desculpas pelo meu Português. Estou usando o Google Translate. :-)
Por favor, pare top postagem
--
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
There are other classes added to the form that may be appropriate to
use as a hook (eg post), and you can also add your own classes to
the form using the same :html option in Rails' form_for helper.
Justin
On Feb 22, 12:52 am, rtacconi rtacc...@gmail.com wrote:
Inside stylesheets I have
Jeremy Woertink wrote in post #892229:
hmm, yeah. It's the weirdest thing. I started a fresh app and tried just
that, and it was a no go. I still get undefined method
acts_as_mappable I'm not sure what's going on, but that's for the
help :)
using:
Ruby 1.8.7
Rails 2.3.5
Geokit 1.5.0
On 23 February 2011 15:26, John Merlino li...@ruby-forum.com wrote:
Thanks for response, but I place this in application controller:
helper_method :current_user
private
def current_user
@current_user ||= session[:user_id] User.find(session[:user_id])
end
And now because all my
Hi everybody!
I have donned my Pink Warrior outfit and done my first release of Rails.
I've pushed the 3.0.5.rc1 release candidate. Please download it and try
it out before I push the real release. Barring any critical bugs, I
plan to make the real release sometimes this weekend.
You can look
Phil Crissman wrote in post #983406:
On Wed, Feb 23, 2011 at 12:09 PM, Aegorov Egorov
li...@ruby-forum.comwrote:
test_word PUT/words/:id/test(.:format) {:action=test,
:controller=words}
GET/session(.:format){:action=show,
:controller=words}
But when i'm going to
Corey W. wrote in post #983408:
Jeremy Woertink wrote in post #892229:
hmm, yeah. It's the weirdest thing. I started a fresh app and tried just
that, and it was a no go. I still get undefined method
acts_as_mappable I'm not sure what's going on, but that's for the
help :)
using:
Ruby
Phil
On Wed, Feb 23, 2011 at 2:18 PM, Aegorov Egorov li...@ruby-forum.comwrote:
Phil Crissman wrote in post #983406:
On Wed, Feb 23, 2011 at 12:09 PM, Aegorov Egorov
li...@ruby-forum.comwrote:
test_word PUT/words/:id/test(.:format) {:action=test,
:controller=words}
Aegorov Egorov wrote in post #983420:
td%= link_to 'Test', :controller=words, :action=test %
get the same error
No route matches {:controller=words, :action=test}
1.i'm find the error. i forgot :id = word.id
--
Posted via http://www.ruby-forum.com/.
--
You received this message because
Thanks Colin! sorry for the stupid error!
I am now getting something new:
h-3.2$ bundle exec autotest
/Users/mattmurphy/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/
bundler-1.0.0/lib/bundler/shared_helpers.rb:100:in `block in
cripple_rubygems': autotest is not part of the bundle. Add it to
On Wed, Feb 23, 2011 at 1:21 PM, Michael Pavling pavl...@gmail.com wrote:
Por favor, pare top postagem
http://en.wikipedia.org/wiki/Posting_style
The traditional style was for a long time to post the answer below as much
of the quoted original as was necessary to understand the reply (bottom or
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
On 23 February 2011 22:42, Bryan Crossland bacrossl...@gmail.com wrote:
On Wed, Feb 23, 2011 at 1:21 PM, Michael Pavling
As further investigation I have looked into the shared_helper.rb file
in the path of the error and found the code that appears to be testing
for it:
spec = specs.find { |s| s.name == dep.name }
if spec.nil?
e = Gem::LoadError.new #{dep.name} is not part of the
bundle. Add it to
Johnny Mejias wrote in post #982828:
i tried rvm but had a couple of problems in mac since rvm is more linux
oriented
What do you mean rvm is more linux oriented. I know a lot of people that
use rvm just fine on Mac OS X. In fact it's been working great on the
Mac for me.
--
Posted via
Ok I've added 'gem 'autotest', '4.3.2' gem 'autotest-rails-pure',
'4.1.0' to the Gemfile for this project and I no longer get the error
and I get the following message:
-bash-3.2$ bundle exec autotest
loading autotest/rails_rspec2
style: RailsRspec2
I reply to the email that I receive which uses the standard method of top
posting. Why? Because if you bottom-posted all the time or unnecessarily
inline quoted it would make this thread:
http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/6c25db52c2d743aaand
others like it
On 23 February 2011 23:07, Bryan Crossland bacrossl...@gmail.com wrote:
I reply to the email that I receive which uses the standard method of top
posting.
What standard? Which RFC says that there is any standard?
if you unnecessarily
inline quoted it would make this thread:
Hiya,
I've taken over maintenance of the tiny_mce gem
(https://github.com/kete/tiny_mce/) and am preparing a release that
will have the latest TinyMCE and take advantage of some TinyMCE jQuery
integration. I'm in the process of getting things working again with
Rails 2.3.x (jQuery integration
You don't need to use nested attributes for that. You can achieve the
same result with a pretty simple virtual attribute:
class Song ActiveRecord::Base
belongs_to :movie
def movie_name=(name)
@movie_name = name
self.movie = Movie.find_or_initialize_by_name(name)
end
def
Reu, thanks a lot!! this is exactly what I want.
Facing one problem when I am using accepts_nested_attributes_for and
has_many. This is working in rails way and able to insert record into songs,
people and people_song table correctly. But again I want to use similar
logic find and initilize. But
Hey all,
with this below (a post has many blog_images and blog_image belongs to
post):
% @posts.each do |post| %
div class=FeatureItem
a href=img src=/images/%=
post.blog_images.image_file_name % width=220 height=174 alt=
style=top: 27px; left: 13px; /Click Here/a
div
On Thu, Feb 24, 2011 at 11:47 AM, John Merlino li...@ruby-forum.com wrote:
Hey all,
with this below (a post has many blog_images and blog_image belongs to
post):
% @posts.each do |post| %
div class=FeatureItem
a href=img src=/images/%=
post.blog_images.image_file_name %
Phil
On Wed, Feb 23, 2011 at 9:47 PM, John Merlino li...@ruby-forum.com wrote:
Hey all,
with this below (a post has many blog_images and blog_image belongs to
post):
% @posts.each do |post| %
div class=FeatureItem
a href=img src=/images/%=
post.blog_images.image_file_name %
If you just need a simple authentication system you can also roll your
own. Ryan Bates has a good screencast for it at Railscasts.com:
http://railscasts.com/episodes/250-authentication-from-scratch
On 21-2-2011 13:38, Gerő Zoltán wrote:
Hello all,
is there any general law what you follow
You application crashed because you probably have a user of type
student but you don't have a matching class for it. As others
explained the migrations and model generations don't use single table
inheritance, so they won't crash on it. Furthermore the generators don't
know which types you
Hi,
I just updated my rails app from 2.3.5 - 2.3.10 and started hitting
this utf-8 encoding issue in my some views. The views use gsub and
trunacate ruby functions.
invalid byte sequence in US-ASCII
Hi,
Song
has_and_belongs_to_many :people
accepts_nested_attributes_for :people
Person
validates :uniqueness = true
If person record not present, nested attributes working great! in rails way.
i.e., inserting into songs, people and people_songs table correctly.
I am interested in:-
*If there is
Hi Mark,
Thanks, yeah latter I saw that.
On Thu, Feb 24, 2011 at 10:54 AM, Mark Kremer m...@without-brains.netwrote:
You application crashed because you probably have a user of type student
but you don't have a matching class for it. As others explained the
migrations and model generations
Problem:
View Code:--
% form_remote_tag :url =
get_reports_backend_billing_billing_reports_path,:update = reports,
:complete = Element.hide('../images/spinner.gif'), :loading =
Element.show('../images/spinner.gif') do %
label
Select Status:
/label
%= select_tag
what version of rails are you using?
On Thu, Feb 24, 2011 at 12:56 AM, Sai Babu li...@ruby-forum.com wrote:
Problem:
View Code:--
% form_remote_tag :url =
get_reports_backend_billing_billing_reports_path,:update = reports,
:complete = Element.hide('../images/spinner.gif'), :loading =
86 matches
Mail list logo