A Z wrote:
> /usr/bin/ruby extconf.rb install sqlite3-ruby
> checking for fdatasync() in -lrt... no
> checking for sqlite3.h... no
>
> make
> make: *** No rule to make target `ruby.h', needed by `sqlite3_api_wrap.o'.
> Stop.
>
Looks like you are missing the development headers for ruby. These ar
Hi all,
Am struggling to get this to work:
I am importing CSV file into the database.
This is my code
def import
file = params[:import][:file]
row_count=0
FasterCSV.parse(file, :headers => true) do |food|
import_this_row = {:id => food[0],
Hallo,
I am quite new to rails an now I am planing to create a new project
and I am laying out the design.
What I want to do is that
1) the users to change dynamically through the admin area of the site
the position of the partials e.g (left, sidebar) and the layout should
display for each part
I need to generate 2 types of URL and have defined my routes as:
map.country_yes
"/:country/
yes", :controller=>"posts", :action=>"country", :yes=>true
map.country_no
"/:country/
no", :controller=>"posts", :action=>"country", :yes=>false
map.yes "/yes", :controller=>"posts", :action=>"index
Hi friends
I am new to get on the rails & I have allready a problem in installing
sqlite3-ruby.
I just made my first programme :Hello world.When I execute
http://localhost:3000/hello_world on my browser,then the following error
comes with it.
[
no such file to load -- sqlite3
RAILS_ROOT: /home/w
Hallo,
I am thinking of developing a new project and I would like
1)from the admin areaof the site to control the partials I wan to be
displayed per page and theirs position.
2)These partials are not always related to the current controller/
action and needs extra models actions in order to be r
On Jan 12, 1:44 am, Chris Bartlett wrote:
> I'm trying to create a method on a model (Note) that finds a subset of
> records, but banging my head against a brick wall. The code so far:
>
You need to join the people table, eg,
find :all, :joins => :person, :conditions => ["notes.created_at <=
Thank You
But where I have to write the line Rake::Task['log:clear'].invoke
It is throwing exception as RAKE uninitialised constant...
On Dec 15 2008, 12:41 am, Jeremy Weiskotten wrote:
> Hema Gonaboina wrote:
> > Hi,
>
> > I want to clear my logs files when they are exceeding certain lim
Hi,
I need to be able to specify for my application, via a configuration
approach (i.e. power user, no nice UI required), a way to automate creation
of a pre-determine set of database records across a few models. So I'll
try to explain as best I can:
* Assume I have a model hierarchy something
That doesn't work since textilize parses it into html and then h will,
of course, take those away. Anyways I found a solution to my problem.
It seems that you shouldn't use textilize but just use RedCloth.new
(message, [:filter_html])
On Jan 11, 8:59 pm, Ryan Bigg wrote:
> h(textilize(@mymessage
Dear all,
Could anyone please suggest about how to export mysql data's to excel.
Is there any plugins or gem to do so?
Thanks in advance
regards,
Jose Martin
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you a
h(textilize(@mymessage))
-
Ryan Bigg
Freelancer
http://frozenplague.net
On 12/01/2009, at 2:50 PM, Mike C wrote:
>
> I installed Redcloth into my app so that it could use Textile.
> However, it seems that textilize (the function used to parse the
> Textile stuff) and h aren't compatibl
I installed Redcloth into my app so that it could use Textile.
However, it seems that textilize (the function used to parse the
Textile stuff) and h aren't compatible. If I do <%= textilize h
@mymessage %> it doesn't work. If I take out the h it works but then I
leave myself open to XSS. Is there
Thanks for the quick reply. The following are the names of the plugins
I presently have installed. None have hyphens.
drwx-- 3 ... ... 4096 2009-01-11 15:38 haml/
drwx-- 5 ... ... 4096 2009-01-11 21:25 restful_authentication/
drwx-- 5 ... ... 4096 2009-01-11 15:38 role_requirement/
O
I installed backgroundrb from http://svn.devjavu.com/backgroundrb/trunk
and there is no problem to start backgroundrb server. but when view the
page which controller requires the worker, I will get the error
"uninitialized constant BackgrounDRb::MetaWorker". Is this the problem
that I didn't requi
http://www.mail-archive.com/rubyonrails-talk@googlegroups.com/msg9.html
says
...rename vendor/plugins/authentication-plugin to something without a
hyphen character (like ‘authentication’ or ‘restful_authentication’).
Hope this helps
On Jan 11, 6:34 pm, Ben Wilson wrote:
> On Jan 11, 9:24
On Jan 11, 9:24 pm, Ben Wilson wrote:
> rake db:migrate RAILS_ENV=production
> rake aborted!
> uninitialized constant User::Authentication
>
> The preceding I encounter when attempting to migrate to the production
> database. My google powers have escaped me. Everywhere says Restful
>
rake db:migrate RAILS_ENV=production
rake aborted!
uninitialized constant User::Authentication
The preceding I encounter when attempting to migrate to the production
database. My google powers have escaped me. Everywhere says Restful
Authentication is missing in the production server.
Martin -
>
>
> On Jan 10, 4:15 pm, sunstalker wrote:
>> Hi,
>>
>> i am desperately seeking for a solution or at least a hint, for
>> preventing non-authorized users of my social network app to access
>> images, uploaded from registered users, without authentication.
>>
>> I already found the HTT
I am reading Obie's book (again) and I am confused about a line on
page 450. This is the book that says "Covers Rails 2.0" in a yellow
circle on the cover.
The erb code is:
<% remote_form_for :addition, @addition, :url => additions_path
:update => 'result' do |f|...
A snippet of the out
I want to make monitoring 1 site...
I don't have idea about it.. so I think that is idea for solve...
do you have idea???
On Sun, Jan 11, 2009 at 11:55 PM, Phlip wrote:
>
> anton effendi wrote:
>
> > I want to run test:unit in controller and the result will show on
> > view. Any body can he
I'm trying to create a method on a model (Note) that finds a subset of
records, but banging my head against a brick wall. The code so far:
class Note
belongs_to :person
def self.can_be_viewed
find(:all, :conditions => ["notes.created_at <= ?",
person.cutoff_date])
end
...
class Pers
Thank you very much to all of you for your help. I really appreciate
it. :)
Pepe
On Jan 9, 2:42 am, Bosko Ivanisevic
wrote:
> I rarely use GUI tools that come with git. Although gitk is really
> excellent if you want to examine history, especially since feature to
> use external diff viewer is
Is there an easy way to rename an element within an XML file after I
have called object.to_xml?
--~--~-~--~~~---~--~~
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 rubyonr
I think I might look into this
http://playtype.net/past/2008/2/6/starling_and_asynchrous_tasks_in_ruby_on_rails/
On Jan 11, 7:39 pm, "James Englert" wrote:
> You could just keep it in memory if accuracy isn't very important.
>
> On Sun, Jan 11, 2009 at 7:00 PM, Mohammad Abed <
>
>
>
> rails-m
You could just keep it in memory if accuracy isn't very important.
On Sun, Jan 11, 2009 at 7:00 PM, Mohammad Abed <
rails-mailing-l...@andreas-s.net> wrote:
>
> I have a site which is basically a catalog of product about 30,000.00
> products. What do you think is the best (in terms of performance
The thread is old, however we got similar error recently with rails 2
and mysql 5.1. It was related to missing fixtures, however the problem
with mysql
our installation is mysql 5.1.22 on CentOS 5 and 5.1.30 on Debian
we were able to reproduce the error with simple seqence of sql commands
sel
I have a site which is basically a catalog of product about 30,000.00
products. What do you think is the best (in terms of performance) way to
keep track of the most popular products,a part from the idea of writing
web-server log parser.
I'm thinking of creating a model called 'product_view' whic
Thanks for the reply,
As Peter suggested I didn't write enough about my problem, I was no
actually saving my file into the database, I was saving into the file
system. But thanks for the advice. On a db based file save your answer
may have been another reason also.
All the best
Richard
On Jan
Peter,
Thanks for your reply, yes I should have posted the nginx.conf
contents.
But yes you were right.
It was the client_max_body_size, I changed this in the nginx.conf then
it worked!
Thanks so much for your help.
Richard
On Jan 11, 8:58 pm, Peter De Berdt wrote:
> On 11 Jan 2009, at 12:5
wolfgang wrote:
> How can I avoid this situation ???
I don't know specifically why Rails generates that particular error, but
that doesn't really matter, because render :json => nil is not valid.
You need to check for nil and respond with a properly constructed error
response, including the pro
Thinking in SQL, you want to do this:
select * from customers left outer join addresses on
customers.address_id = addresses.id
where addresses.id is null.
First thing that comes to mind here something like:
Customer.find(:all, :include => :address, :conditions => 'addresses.id
is null')
hope
for anyone else who might come across this, i found field_error_proc.
you can over ride it and have it automatically add the errors, you can
leave the error_message_on out of your code completely. you just add
this code to an initializer.
i combined it with the second example to also stop rails f
Check out the File class.
http://www.ruby-doc.org/core/classes/File.html#M002559
File.delete("#{RAILS_ROOT}/public/system/photos/original/1/photo.jpg")
That should do it.
-John
On Jan 11, 12:48 pm, John Smith
wrote:
> I want to delete a file that is in
> public/system/photos/original/1/photo.
I am trying to use active record outside of rails using sqlite3-ruby (on
OSX Tiger). This worked find with ruby 1.8.
After installing Ruby 1.9 using MacPorts (and installing rails and
sqlite-ruby gem) I am getting an error (trace below) whenever I try to
save changes (just retrieving works fine)
Hi,
I have a Customer model that has_many :addresses, is there a way (via
named scope or any other method that's ... ehm ... model side) to
obtain all the Customers that don't have any addresses at all (for
which the associated array would be empty)?
Thank you for the answer...
--~--~-~-
thanks - given all of this what do you think about the fact Rails doesn't
highlight the issue via exception? It still seems misleading to me the way
it works...
On Sun, Jan 11, 2009 at 10:32 PM, Mikel Lindsaar wrote:
>
> > a = Account.find(1)
> > new_account = Account.new(a.params)
> > new_acco
Frederick Cheung schrieb:
> You can override initialize, but you just need to ensure you call the
> superclass implementation properly.
Oh, thanks for this additional information, I see I've to read the docs ,)
g,
Daniel
--
“Das ich erkenne, was die Welt im Innersten zusammenhält” (Faust I
On 11 Jan 2009, at 19:26, Robby Russell wrote:
> On Fri, Jan 9, 2009 at 12:14 AM, jasoo24 wrote:
>> I am desperately seeking a super-FAST Rails host that won't cost me
>> an
>> arm-and-a-leg. I will check out all the suggestions mentioned here,
>> but -
>
> It really depends on what you consi
On Fri, Jan 9, 2009 at 12:14 AM, jasoo24 wrote:
>
> For your needs, I would also have to recommend Dreamhost. You can
> deploy production-ready apps through Capistrano and it is a great and
> inexpensive Rails sandbox.
>
> HOWEVER, Dreamhost is slow to a crawl. It's actually unacceptably slow
> f
receiving a date string param[:company][:contracted_on] like
"11/01/2009"(format "%e/%m/%Y")
what should I write to convert the params into an acceptable DateTime
attribute in the DB, ?
(in a before_save in my model... )
thanks for your suggestions
Happy New Rails btw ..
erwin
--~--~--
I want to delete a file that is in
public/system/photos/original/1/photo.jpg. How can I delete it?
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" grou
On 11 Jan 2009, at 16:34, cutegirl wrote:
I used "scaffold" in my controller. But an error messaged said it is
an undefined method. What is the correspoinding new method to this
one? Thanks
there isn't one. dynamic scaffolding was removed. It may have been
extracted into a plugin.
Fred
-
Hassan Schroeder wrote:
> Thread.current[:wtf] = request.user_agent
> to a controller in an app, and fetching a page displaying that variable
> with three different browsers using Apache 2.2.9 + Passenger 2.0.3
> (on OS X).
>
> In each case I got the expected (different) user agent string.
anton effendi wrote:
> I want to run test:unit in controller and the result will show on
> view. Any body can help me???
> Wu You Duan
(BTW which one are you?)
You can run a script from the view like this:
<%=h `rake test:units` %>
However, why would you do such a thing? Unit tests sh
I used "scaffold" in my controller. But an error messaged said it is
an undefined method. What is the correspoinding new method to this
one? Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk"
Hai Guys..
I need help..
I want to run test:unit in controller and the result will show on view.
Any body can help me???
--
Wu You Duan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" gr
Processing PostsController#index (for 127.0.0.1 at 2009-01-11 17:24:48)
[GET]
Parameters: {"m"=>"01", "y"=>"2009"}
SQL (0.1ms) SET client_min_messages TO 'panic'
SQL (0.1ms) SET client_min_messages TO 'notice'
Post Load (4.5ms) SELECT * FROM "posts" WHERE (extract(year from
created
ok I've got answer somewhere else :
http://www.postgresql.org/docs/8.3/interactive/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS
this E is a part of postgres ""
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because yo
Oskar Szrajer wrote:
> hmm after changing LIKE to =
>
> in sql code is still "E "
>
> but it's start works, return proper page ?? now it's big question for me
> what that E is and whay it's work now?
What is in the params = {}, in the output of your script/console when you run
that?
--~--~-
hmm after changing LIKE to =
in sql code is still "E "
but it's start works, return proper page ?? now it's big question for me
what that E is and whay it's work now?
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message beca
I think there will not a problem in link_to but I've try to use a
url_for
LIKE in condition is not a problem too I've check with = and still
getting something similary:
@posts = Post.find(:all,:order => 'created_at' ,:conditions =>
['extract(year from created_at) = ? AND extract(month from
Oskar Szrajer wrote:
> I've something like that:
>
> in layout :
> links looks that :
>
> <%= link_to month.strftime('%B, %Y'),
> "/?y=#{month.strftime("%Y")}&m=#{month.strftime("%m")}" %>
Don't write a raw URI path and query, and don't use string surgery to create
one. Add those items as the
MaD wrote:
>> @word = params[:search][:word] || params[:word] || "home"
> you can still do that. there is only a problem if params[:search] is
> nil. because then you'd try to evaluate nil.[] which again leads to an
> error. this is what Phlip wanted to tell you way up in this thread.
And if Ja
I think the safest way is to store images outside your public
directory for storing images. Then create (controller and) action to
retrive images using send_data. For example:
@person = Person.find(@params['id'])
File.open(@person.picture, "rb") do |image|
send_data image, :filename => @person.
It's a litle bit old, but you can probably get a lot of good ideas
from it ->
http://www.rubyinside.com/restful-rails-development-pdf-released-392.html
-
Maurício Linhares
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en)
On Sun, Jan 11, 2009 at 7:36 AM, Joshua Partog
On 11 Jan 2009, at 11:33, Daniel Völkerts wrote:
>
> Frederick Cheung schrieb:
>
>> Have you override initialize in you Node class ?
>
> Hi Fred,
>
>
> aaah yes. I already found the problem. As you mentioned, I overwrote
> initialize in my Node class which inherits AR::Base.
>
> Damn I didn't kn
On 11 Jan 2009, at 14:04, Commander Johnson wrote:
> Hi,
>
> I've created a simple wizard that collects data in 3 steps and then
> posts it to a Create action.
>
> Validation is only performed when the data is posted. However, I
> would like the individual steps to be validated as well. Any
Hello all,
I have the following scenario.
The user will input a name for the student to be added, since you can have
duplicate names, the user will be the one in charge of checking if he is not
adding the same student two times.
There are other fields that can be used in order to check it, but it
Hi,
I've created a simple wizard that collects data in 3 steps and then posts it
to a Create action.
Validation is only performed when the data is posted. However, I would like
the individual steps to be validated as well. Any ideas on this one?
Example:
Step 1
Name
Email
Email (confirm)
Is t
I've something like that:
in layout :
links looks that :
<%= link_to month.strftime('%B, %Y'),
"/?y=#{month.strftime("%Y")}&m=#{month.strftime("%m")}" %>
in controler I've :
if params[:y] && params[:m]
@posts = Post.find(:all,:order => 'created_at' ,:conditions =>
['extract(year from cr
He's missing include AuthenticatedSystem from application.rb
-
Ryan Bigg
Freelancer
http://frozenplague.net
On 11/01/2009, at 5:04 PM, Matt Darby wrote:
>
> shahroon ali wrote:
>> Yeah I checked it was installed properly, there was no error in
>> installing
>> it, i was just mistaken.
MaD is right, no matter what the expression, you will always get an
exception if you try to evaluate nil.[]
You can divide the expression in two:
city = (params[:user]) ? params[:user][:city] || "xxx" : "xxx"
Cheers, Sazima
On Jan 11, 10:07 am, MaD wrote:
> > @word = params[:search][:word] ||
> a = Account.find(1)
> new_account = Account.new(a.params)
> new_account.id = new_id
> new_account.save
>
> *should* work :)
Well.. it most definitely won't...
You need:
new_account = Account.new(a.attributes)
and you might get further
--
http://lindsaar.net/
Rails, RSpec and Life blog
Now.. that is interesting
To be honest, I've only ever used setting the id to a specific value
on a new record... not on an existing one.
The problem is that the following code in
rails/activerecord/lib/base.rb is what does the update:
def update(attribute_names = @attributes.keys)
> @word = params[:search][:word] || params[:word] || "home"
you can still do that. there is only a problem if params[:search] is
nil. because then you'd try to evaluate nil.[] which again leads to an
error. this is what Phlip wanted to tell you way up in this thread.
--~--~-~--~~-
Vishwanath Nayak wrote:
> @city = params[:user][:city] if params[:user] &&
> params[:user][:city]Should
> do the trick
Yes it do, but it not simple any more, as it was before.
For example: This works in old rails versions, but not in (2.2.2), why?
@word = params[:search][:word] || params[:word
maybe you got a limit in your database. you could set
max_allowed_packet = 32M
look here: http://dev.mysql.com/doc/refman/5.1/en/packet-too-large.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails
On 11 Jan 2009, at 12:51, Richard wrote:
> I am trying to upload 30mb files with attachment-fu, these seem to
> just hang. (works file for small image files)
> I am using mongrel cluster and nginx...
>
> Does anyone have any advice?
Check your nginx conf file and set the client_max_body propert
Look at your server's log, you can find the parameters for each
request.
eg.
Processing XxxController#update (for 127.0.0.1 at 2009-01-10 14:44:03)
[GET]
Session ID: 4598628b1689321ec39c1b22fb0e7728
Parameters: {"param1"=>"...", "param2"=>"...", ...}
Jej
--~--~-~--~~
Hi
I am trying to upload 30mb files with attachment-fu, these seem to
just hang. (works file for small image files)
I am using mongrel cluster and nginx...
Does anyone have any advice?
Thanks
Richard
--~--~-~--~~~---~--~~
You received this message because you
PS. Just noted the other methods also don't work fyi - see below. That is
it doesn't seem to be mass assignment related.
?> ai = AccountItem.find(:first)
=> #, balance:
#, description: "test", notes: nil,
created_at: "2009-01-11 09:47:28", updated_at: "2009-01-11 09:47:28">
>> ai.id = 10
=>
thanks Mike - I was trying to setup a spec that tests that my foreign key
constraints would hold - I'll try the method you suggest
On Sun, Jan 11, 2009 at 9:38 PM, Mikel Lindsaar wrote:
>
> On Sun, Jan 11, 2009 at 9:08 PM, Greg Hauptmann
> wrote:
> > Why does ActiveRecord allow perception of su
On Sun, Jan 11, 2009 at 9:08 PM, Greg Hauptmann
wrote:
> Why does ActiveRecord allow perception of success when updating an ID,
> however it doesn't really work(i.e. no change in database)?
That is because :id is a special case and is protected from mass assignment.
The reason it "works" or say
Frederick Cheung schrieb:
> Have you override initialize in you Node class ?
Hi Fred,
aaah yes. I already found the problem. As you mentioned, I overwrote
initialize in my Node class which inherits AR::Base.
Damn I didn't know that this isn't allowed :( Fixed failures lead to
better code *g
Hi,
Why does ActiveRecord allow perception of success when updating an ID,
however it doesn't really work(i.e. no change in database)?
Here's an example. The update of "id" versus update of a non-existent
attribute.
?> ai = AccountItem.find(:first) => #, balance:
#, description: "test", notes: ni
Dear all,
Is it possible to use rails as a RESTful web service? Has anyone done
this before? Is there any drawback when doing this? Could anyone share
their experiences?
Thanks in advance.
--~--~-~--~~~---~--~~
You received this message because you are subscribed
77 matches
Mail list logo