Hello All,
I am using scaffolding but i can not figure out that how to write my own
methods except CRUD. I mean i know how to use CRUD methods but if i
write my own method in my controller and call that from views then the
request is going to show method.
Ok.. the scenario is that have an method
Anderson Leite wrote:
> Hello Marnen
>
> "keep translated strings in PO files "
>
> but think about a content management system that users put information
> about a new protuct in english and portuguese.
>
> It's easy to use i18n for labels...but.what about the product
> description ??
>
Fernando Perez wrote:
>> I'm just worried I'm going to waste money on an outdated book :)
>>
>> Thanks again for your time.
>> Jeremy
>
> The book is overbloat. The author suggests to run your rails setup in a
> Xen virtual machine! Well he sells rails hosting...
>
> Capistrano is not necessary
can anyone help me here. i assume that there is a way to do this...
--
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-t...@googlegroups.com.
To unsu
Ofcourse, my "firstapp" and "secondapp" (both) are ruby on rails apps.
--
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-t...@googlegroups.com.
To u
Env: In VirtualBox / Ubuntu Lucid / current stable version of Ruby on
Rails / Apache2 / Passenger
I have one app called "firstapp" hosted in my localhost
I think i added one entry to apache2.conf file to view this app from the
browser.
So, now i can access this from the browser 127.0.0.1:3000
No
anybody?
On Jun 30, 6:49 pm, Me wrote:
> How do you do ajax functions likesubmit_to_remoteor link_to_remote
> to ajax update stuff on the page inrails3?
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email t
You could either use the find_by_sql method or the :joins method. (As
someone has stated earlier that avoid find_by_sql for performance and
maintanence reasons)
sample sql to put in find_by_sql in your model
select question_id from responses r1
where not exists
(select question_id from questio
no i am talking about github .. remote repository,, because lot of
tutorials i go through are pointing towards this...
On Jul 1, 5:32 pm, Hassan Schroeder
wrote:
> On Thu, Jul 1, 2010 at 3:54 PM, Ali Imran wrote:
> > I looked for the way to use any thing else other than GIT, because it
> > is
I will try, I am a newb not sure how to do tests
On Jul 1, 6:49 pm, Hassan Schroeder
wrote:
> On Thu, Jul 1, 2010 at 6:09 PM, badnaam wrote:
> > Strangely, this method returns true for an update
>
> Can you post a simple test case demonstrating this behavior?
>
> --
> Hassan Schroeder --
On Thu, Jul 1, 2010 at 6:09 PM, badnaam wrote:
> Strangely, this method returns true for an update
Can you post a simple test case demonstrating this behavior?
--
Hassan Schroeder hassan.schroe...@gmail.com
twitter: @hassan
--
You received this message because you are
i'm trying to see if any would return false in your case, as the record
already exists for update.
stumbled upon this:
https://rails.lighthouseapp.com/projects/8994/tickets/1219-new_record-not-set-when-using-joins
let me know if there is any clue here?
(assert ?)
badnaam wrote:
> Well so it
Well so its of no use if one wants to check if the record is a brand
new record or an updated one
On Jul 1, 6:13 pm, RailsFan Radha wrote:
> I just read this from the "Simply Rails 2" book
>
> model.new_record?
> If it is not yet saved, will return true.
> If saved, will return false.
>
> Excerpt
I have three models, Question, Response and User
User has many question, :through Responses
My response table has 3 main columns response, question_id and
user_id.
The use case is lets say the user can respond to 100 question, but
during a session he responds to 20. How do I find out the ones he
I just read this from the "Simply Rails 2" book
model.new_record?
If it is not yet saved, will return true.
If saved, will return false.
Excerpt from this book:
>From the Rails console, let’s create this Story class, and an instance
of the class called story, by entering these commands:
>> clas
Strangely, this method returns true for an update, thats why I wasnt
sure. Does this only check if that "self" instance has been saved or
not?
On Jul 1, 6:03 pm, Filipe Quadros Borges wrote:
> try '@record.new_record'
>
> http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M001843
>
> O
try '@record.new_record'
http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M001843
On Thu, Jul 1, 2010 at 9:57 PM, badnaam wrote:
> Is it possible to check if the record that is about to be saved is a
> brand new record or an update? I am trying to do this inside a
> before_save callback
On Thu, Jul 1, 2010 at 2:39 PM, melomane wrote:
> Every auction is available for just one week. If i convert the string
> to date i can easily add one week to the date. During the week for
> every goods, clients can input their desired prices.But the new
> problems arise, how can I find today's d
Is it possible to check if the record that is about to be saved is a
brand new record or an update? I am trying to do this inside a
before_save callback.
I am on rails 2.3.8
Thanks
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post
On Jul 1, 2010, at 7:31 PM, Gerwin wrote:
> Hi,
>
> I was wondering how to communicate with my web app from e.g. a C++/C#
> application. I know how to use the HTTP Rest methods but was wondering
> about the following:
>
> * How to use POST with the authenticity_token (how do I get the
> token?)
Oh, and I should add I'm using beta3.
On Jul 1, 4:38 pm, Fernando Perez wrote:
> cult hero wrote:
> > I have kind of an interesting problem.
>
> No this problem is boring and is known since at least 2008. It just bit
> my ass with Rails 2.3.8.
>
> Here is a beautiful fix:http://redmine.ruby-lang.
It's definitely not mysql related. I'm not using MySQL. I'm using
PostgreSQL and I'm using Sequel. All the strings coming from the
database are UTF-8.
And I saw A LOT about the magic comment, but where do I put it in a
template? And there's no way to basically set a "default" magic
comment?
On Ju
> I'm just worried I'm going to waste money on an outdated book :)
>
> Thanks again for your time.
> Jeremy
The book is overbloat. The author suggests to run your rails setup in a
Xen virtual machine! Well he sells rails hosting...
Capistrano is not necessary when you know how to use a good scm
cult hero wrote:
> I have kind of an interesting problem.
No this problem is boring and is known since at least 2008. It just bit
my ass with Rails 2.3.8.
Here is a beautiful fix: http://redmine.ruby-lang.org/issues/show/1238
I don't know exactly how to fix all this mess.
--
Posted via http://
On Thu, Jul 1, 2010 at 3:54 PM, Ali Imran wrote:
> I looked for the way to use any thing else other than GIT, because it
> is not free
Huh? Where did you get that idea?
>From the git site:
Git is a free & open source, distributed version control system
designed to handle everything from sm
Hi,
I was wondering how to communicate with my web app from e.g. a C++/C#
application. I know how to use the HTTP Rest methods but was wondering
about the following:
* How to use POST with the authenticity_token (how do I get the
token?)
* How to maintain a session (i.e. login and keep the se
thanks Marnen. this is exactly what i as looking for.
Your answer is informative and it explains why i should avoid writing
sqls in it.
thanks again.
-radha.
Marnen Laibow-Koser wrote:
> RailsFan Radha wrote:
> [...]
>> What is the bext practice in this case? (Yes, I always want to show the
>>
If anyone has read the book,
Sitepoint "Simply Rails 2 " book.
then...
here is my mind breaking q:
Page 331
-
Join Model Relationship:
He has User Model, Story Model and Votes Model in the sample scenario
which he is walking through in this book.
User can write many stories. So, User :has
I am also new on Rails, This thread is very helpful. I also started
development from windows but when i reached at the point of passenger,
than I moved to Linux Ubuntu.
I start working with godaddy hosting, but face some problems than i
move to site5.com and successfully upload my first demo proje
I have a model (Parent) that has a has_many association with another
model (Child). I read that there are performance issues (relating to
GC) with too many associations. I was about to add more has_many
associations to the parent model to get child objects ordered by
different columns like so:
(
Ali Imran wrote:
> Yes of course
Hello :)
can you give me some of your hardware details, such as the laptop model,
os version, and so on please ?
we want virtualrails to be as little buggy as possible, and if there is
a way to solve your problem, we'll try to find it :)
--
Posted via http://w
Yes of course
On Jun 22, 11:35 pm, Ali Imran wrote:
> Do Now I need to install Ruby on rails on my virtual machine..
>
> On Jun 22, 11:09 pm, Ali Imran wrote:
>
> > here is how...
>
> >http://www.pendrivelinux.com/running-linux-from-within-windows-virtua...
>
> > here is iso
>
> >http://www.linu
On Thu, Jul 1, 2010 at 12:09 PM, cult hero wrote:
> I have kind of an interesting problem.
>
> I have a form wherein people enter information. Big surprise. If they
> enter any "weird" characters like ø or é or whatever, the form will
> submit and all is well. However, I have a select box for the
Hello Marnen
"keep translated strings in PO files "
but think about a content management system that users put information
about a new protuct in english and portuguese.
It's easy to use i18n for labels...but.what about the product
description ??
I can't put product description into a PO
Yes you are right, thanks
On Jun 30, 3:51 pm, Robert Walker wrote:
> Ali Imran wrote:
> > i look at the apache config and i set the globaluser name for git but
> > it did not work
>
> I think you've gone completely off-topic at this point. You really need
> to take this to an appropriate Git for
Hi everyone. I know that the subject I chose is general, but it is a
mixture of problems.
I searched a lot in the group, in AWD with Rails book and some forums
and found a lot of threads but none of them solved my problem, many of
them didn't work at all.
The web site manager is going to set a star
Anderson Leite wrote:
> Hello all.
>
> It's ok to internationalize thing at app using rails, but how to deal
> with content from database ?
>
I think that may not be a good approach. I think it's better to keep
translated strings in PO files -- that way, you can hand them off to
translators.
Chris Kalaboukis wrote:
> Chris Habgood wrote:
>> Here is something to close modalbox, rjs:
>>
>> page.call 'Modalbox.hide();'
>
> Thanks Chris... this is what I get when I try that:
>
> undefined local variable or method `page' for
> #
>
> any ideas?
also tried this:
render :update do
Hello all.
It's ok to internationalize thing at app using rails, but how to deal
with content from database ?
What's the best aproach ? I don't wanna do things like:
<% if english %>
<%= obj.name_english%>
<% else %>
<%= obj.name_japanese%>
<% end %>
The best way is to do all at controll
Chris Habgood wrote:
> Here is something to close modalbox, rjs:
>
> page.call 'Modalbox.hide();'
Thanks Chris... this is what I get when I try that:
undefined local variable or method `page' for
#
any ideas?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you
Here is something to close modalbox, rjs:
page.call 'Modalbox.hide();'
On Jul 1, 12:49 pm, Chris Kalaboukis wrote:
> hi guys:
>
> I'm scratching my head on this one: I have a twitter app where I'm
> trying to open a modalpopup with a twitter sign in, get them to sign in,
> then close the popup a
I tried passing the session id around to the model, and agree that it is
very ugly.
I am curious to know how you can best achieve this scenario without passing
in the session variable: abort a delayed_job (or other model based) work
item when user changes something - this is mainly required becaus
Craig White wrote:
> On Thu, 2010-07-01 at 21:23 +0200, Jack Fall wrote:
>>
>> else
>> format.html { render :action => "new" }
>> format.xml { render :xml => @post.errors, :status =>
>> :unprocessable_entity }
>> end
>> end
>> end
>>
>
> def create
> @pos
Jack Deadcore wrote:
> Hello there,
> I am new around here and have been looking over the internet for a
> solution but can't find one. I am fair new to rails but have a decent
> understanding of it to get by and a few years experience behind me.
> My problem is that I try to insert data in a datab
On Thu, 2010-07-01 at 21:23 +0200, Jack Fall wrote:
> Hello there,
> I am new around here and have been looking over the internet for a
> solution but can't find one. I am fair new to rails but have a decent
> understanding of it to get by and a few years experience behind me.
> My problem is that
Hello there,
I am new around here and have been looking over the internet for a
solution but can't find one. I am fair new to rails but have a decent
understanding of it to get by and a few years experience behind me.
My problem is that I try to insert data in a database and it does not
come up. Th
I have kind of an interesting problem.
I have a form wherein people enter information. Big surprise. If they
enter any "weird" characters like ø or é or whatever, the form will
submit and all is well. However, I have a select box for the state
which, if you're looking at Spain, has states like A C
hi guys:
I'm scratching my head on this one: I have a twitter app where I'm
trying to open a modalpopup with a twitter sign in, get them to sign in,
then close the popup and refresh the main window. My code however
refreshes the main window with the popup window result, which I thought
was really
On Thu, Jul 1, 2010 at 12:45 PM, Marnen Laibow-Koser
wrote:
> Leonardo Mateo wrote:
>> On Thu, Jul 1, 2010 at 5:10 AM, Gabor Antal
>> wrote:
>>>
>>>
>>> But since this, I have no idea how can I install the rake, rail, etc.
>>> packages with gem from local files because the firewalls do not allowe
RailsFan Radha wrote:
[...]
> What is the bext practice in this case? (Yes, I always want to show the
> active records only ).
> Using find_by_sql or using a condition in the find :all ? ( I like SQLs,
> but as far as the performance goes which approach is better? )
The performance is probably
An update to this post:
Here, i'm trying to figure out which is the better approach or best
practice to show only active categories records from the category table.
Also, i want to prevent any SQL injection.
Do u think, using find_by_sql approach could protect the page from sql
injection to vi
Leonardo Mateo wrote:
> On Thu, Jul 1, 2010 at 5:10 AM, Gabor Antal
> wrote:
>>
>>
>> But since this, I have no idea how can I install the rake, rail, etc.
>> packages with gem from local files because the firewalls do not allowe
>> me public internet connection in this host.
>>
>> Can you help m
As I have said, I've realised the problem is not with the controller
code that's under discussion but with a lib file that takes precedence
over it. Conversing more on the matter would be an exercise in futility,
however.
That said, Marnen & Robert, I will read that Wiki and have absorbed what
y
Colin Law wrote:
> On 29 June 2010 03:19, RailsFan Radha wrote:
>>>
>>> � def list
>>
>> �def self.find_active_categories
>> � � �find_by_sql("SELECT * from category
>> � � � � � where status = 'A')
>> � � �order by category_id ")
>> �end
>
> Don't use find_by_sql unless absolutely necessary.
the batman wrote:
> I have a photos model which has a field for a gallery title, I have a
> gallery controller which currently shows all photos that don't have an
> empty gallery title field.
This is an unnormalized schema, since the gallery title repeats in each
record that belongs to the same g
Pale Horse wrote:
> Robert Walker wrote:
>> Pale Horse wrote:
>>> My controller code can be seen here:
>>>
>>> http://pastie.org/1026480
>>
>> Oh, where to begin. Unless I'm completely daft, I see only one single
>> line in your new method that belongs in a "new" action.
I don't have a lot to s
I have a photos model which has a field for a gallery title, I have a
gallery controller which currently shows all photos that don't have an
empty gallery title field.
I want to have on my gallery page a photo from each gallery that has a
unique title, which would link to 'gallery/gallery-title',
Robert Walker wrote:
> Pale Horse wrote:
>> My controller code can be seen here:
>>
>> http://pastie.org/1026480
>
> Oh, where to begin. Unless I'm completely daft, I see only one single
> line in your new method that belongs in a "new" action.
I can't argue with that but this is not my site. F
Pale Horse wrote:
> My controller code can be seen here:
>
> http://pastie.org/1026480
Oh, where to begin. Unless I'm completely daft, I see only one single
line in your new method that belongs in a "new" action.
This one:
@project = Project.new
Compare your method with what a new method shoul
Kenneth wrote:
> This error means you did not have the required dependencies to install
> readline during installation of ruby. If you can find the location of
> the ruby source files in your system, you can go to the ext/readline
> folder. In there there should be an extconf.rb which you ca
Thanks for the tips Colin and Anand... Neither corrected the issue. I'm
going to see if I can do this from another system. I'm wondering if my
installation is jacked up or something. I'll post again and let everyone
know what i've found. I'm on my system at work, so am limited by what I
can do.
ok thx
On Wed, Jun 30, 2010 at 8:59 PM, Me wrote:
> You need to add condition, where if a box is checked show div.
>
> On Jun 30, 7:11 pm, tom wrote:
> > hi,
> > im gettin lost with the subject. need some pointers:
> >
> > Usermodel:
> > validates_presence_of :companyname, :if => :i
hi...
U learned ror 3 month ... i think u also have a knowledge in .NET
compare it ...by itself
Ror is the programmers haven ... programmer's life here is so cool ...
I hope the first page in ror book is it's ... benefits and virtues... still
u asking ... questions...
-Shyam
On Thu, Jul
On Thu, Jul 1, 2010 at 2:43 AM, Jason Michael wrote:
> So switch, and do it quickly!
+1
>
> On Thu, Jul 1, 2010 at 12:40 AM, palani wrote:
>> which one i choose .net or ror
>>
>> i'm kumar from chennai.now i'm working as a ruby on rails programmer
>> (3 months experience).
>> now i want to switc
On Thu, Jul 1, 2010 at 5:10 AM, Gabor Antal wrote:
> Hi,
>
> I am fighting to install Redmine therefore I need to install Ruby on
> Rails to a machine behind many firewalls. OS is RHEL.
>
> My idea was to download the packages, make and install...
>
> There was some difficulties because the latest
yeah that would be a great idea... though in brazil there's no spam's to
eat.
i guess i just had a new dream. *someday, I'll eat spam's*.
Sempre Alerta Para Servir,
Lucas Franceschi
Equipe de Programação (Automação)
SGI Sistemas
(049) 9922-3360
On Thu, Jul 1, 2010 at 8:02 AM, Colin Law wrote:
This error means you did not have the required dependencies to install
readline during installation of ruby. If you can find the location of
the ruby source files in your system, you can go to the ext/readline
folder. In there there should be an extconf.rb which you can run with
ruby extconf.rb
hi all
I have a has_many_polymorphs relationship that involves the following
classes:
class DigilearningModule < ActiveRecord::Base
has_many_polymorphs :members,
:from => [:digilearning_titles, :lesson_categories,
:lesson_category_groups],
:through => :digilearning_module_memberships,
Hi,
I am trying Rails 3 and I am using RVM to manage the ruby versions.
Using RVM I had installed ruby versions 1.8.7, 1.9.1 and 1.9.2
When I do "rails console" I am getting the following error and console
isn't starting: http://www.pastie.org/1026503
Since I dont require 1.9.1 any more to work
I have a array of Projects, which contains all Projects that have their
'display' object set to 1 (true).
The problem is: when I create a new record, I tried changing the value
of 'display' to false. This did not change the value as false when it
entered the database. In contrast to this, when I e
On 1 July 2010 11:38, lucas franceschi wrote:
> omg, now spams are coming to groups?
> I'm afraid we'll soon need to start checking our microwaves for spam too..
Don't forget to take it out of the can or it will wreck the microwave
Colin
>
>
> Sempre Alerta Para Servir,
>
> Lucas Franceschi
> E
I had problem even though I had installed mongrel --pre.
In Gemfile you need to specifically point mongrel to use "1.2.0.pre2"
or else it will try to use the old version, even if you remove it from
the cache.
On Jun 20, 2:22 pm, Anthony Green wrote:
> More digging and the answer is to install m
I had problem even though I had installed mongrel --pre.
In Gemfile you need to specifically point mongrel to use "1.2.0.pre2"
or else it will try to use the old version, even if you remove it from
the cache.
On Jun 20, 2:22 pm, Anthony Green wrote:
> More digging and the answer is to install m
omg, now spams are coming to groups?
I'm afraid we'll soon need to start checking our microwaves for spam too..
Sempre Alerta Para Servir,
Lucas Franceschi
Equipe de Programação (Automação)
SGI Sistemas
(049) 9922-3360
On Thu, Jul 1, 2010 at 6:53 AM, Sridhar Golyandla wrote:
> Hi,,
> I find
Hi,,
I find a good website, I would like to introduce it to you,It will
give you big surprise:excellent products,high quality, competitive
price. If you are free, please visit it: http://icbcshop12.info .
have a nice day! 7--7
--
You received this message because you are subscribed to the
Neil Bye wrote:
>
>> I suggested that in the link_to it should be
>> :id => @story_id
>> which provides the value (2 in the case you showed), not
>> :id => "@story_id"
>> which provides a string "@story_id"
>>
>> I think you need to go through some basic ruby tutorials if that does
>> not make se
> I suggested that in the link_to it should be
> :id => @story_id
> which provides the value (2 in the case you showed), not
> :id => "@story_id"
> which provides a string "@story_id"
>
> I think you need to go through some basic ruby tutorials if that does
> not make sense.
>
> Colin
<%= link_
On 1 July 2010 10:01, Neil Bye wrote:
>
>>
>> You should have been able to work it out from this, it is getting the
>> string @story_id instead of 2
>>
>> Colin
>
> How can I make it take 2 without using @story.id to find it. If I move
> to story 3 it has to send 3. How does it know to do so? Sorr
>
> You should have been able to work it out from this, it is getting the
> string @story_id instead of 2
>
> Colin
How can I make it take 2 without using @story.id to find it. If I move
to story 3 it has to send 3. How does it know to do so? Sorry I just
can't get it.
--
Posted via http://www
Our app has two user models, User and Admin, each with their own non-
overlapping UI.
Users have a reasonably simple crud page, let's call it "foods", and
we want to add "foods template" functionality to the admin ui.
Basically reusing the food model, but with a blank user_id FK, as
default data
On 1 July 2010 09:41, Neil Bye wrote:
> Colin Law wrote:
>> On 30 June 2010 23:45, Neil Bye wrote:
@story.id? �You could just display it on the page
>>>
> You can
>> also look at the html of the page (view page source in browser) to
>> check that the id is there in the href.
>>
>> Add code
Colin Law wrote:
> On 30 June 2010 23:45, Neil Bye wrote:
>>> @story.id? �You could just display it on the page
>>
You can
> also look at the html of the page (view page source in browser) to
> check that the id is there in the href.
>
> Add code to show the id on the page and check that it als
Hi,
I am fighting to install Redmine therefore I need to install Ruby on
Rails to a machine behind many firewalls. OS is RHEL.
My idea was to download the packages, make and install...
There was some difficulties because the latest Ruby in the RHEL repo was
not modern enough for gem. So I donwlo
83 matches
Mail list logo