What is Mass Assignment?
Can you give me a clear idea about that with an example?
--
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...@googlegro
Hi thank you very much ,you got my point and understand my thinking you
suggest good idea ,i am new to ruby on rails so please suggest rails
tags also for array of check boxes.How serialize array of that hobbies
object and store in database
--
Posted via http://www.ruby-forum.com/.
--
You re
djangst wrote in post #971568:
> Sounds like you want a button with the onclick event. If so, there's
> (apparently) a helper for that:
>
> http://apidock.com/rails/ActionView/Helpers/JavaScriptHelper/button_to_function
@djangst: that's what I've ended up doing. Upon reflection, I'm
wondering why
Okay, it took me a few hours but I completed my first engine for rails
3.1 edge. I found several very handy articles and start points in case
anyone else wants to learn more about rails engines. Here are the links
and resources I found:
http://piotrsarnacki.com/2010/09/14/mountable-engines/
h
Sounds like you want a button with the onclick event. If so, there's
(apparently) a helper for that:
http://apidock.com/rails/ActionView/Helpers/JavaScriptHelper/button_to_function
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post
On Dec 30, 2010, at 3:17 PM, byron appelt wrote:
> I am trying to get reject_if to work using a method name instead of a
> Proc. However I cannot seem to get this to work. A simplified version
> of my model code is shown below. The problem is that I keep getting an
> "undefined method `call' for
I need to do some JS processing in the client before contacting the
server (fwiw, this is for Google geocoding). The JS does its processing
and concocts a form to send back to the server. The latter part is
working fine.
In a previous iteration, I had the following. It activated the JS code
on
I am trying to get reject_if to work using a method name instead of a
Proc. However I cannot seem to get this to work. A simplified version
of my model code is shown below. The problem is that I keep getting an
"undefined method `call' for :not_wired?:Symbol" error. I am using
Rails 2.3.4. Can anyo
Greg Ma wrote in post #971151:
> ActiveRecord::StatementInvalid (Mysql::Error: Operand should contain 1
> column(s): SELECT * FROM `conversations` WHERE (conversations.started_by
> = 1 OR conversations.with = 1) AND (SELECT * FROM conversations c WHERE
> (c.started_by = 1 OR c.with = 1)) ORDER BY
Oren Golan wrote in post #923611:
> I had this issue after upgrading from ubuntu 9.10 (karmic) to 10.4
> (lucid).
> the solution was to libmysqlclient16-dev:
>
> sudo aptitude install libmysqlclient16-dev
As a Ubuntu user that did the trick for me.
Thanks a lot, Oren! Your decision to post this pr
On Dec 30, 2:03 pm, Colin Law wrote:
> On 30 December 2010 20:34, Geo Manickam wrote:
>
>
>
>
>
>
>
>
>
>
>
> > On Dec 30, 2:06 am, Colin Law wrote:
> >> On 30 December 2010 04:32, Geo Manickam wrote:
>
> >> > I tried address still not able to display the address form.
>
> >> > <% person_form
On 30 December 2010 20:21, Bo wrote:
> Here are my tables
>
> patients
> id name
> 1 Bob
> 2 Carol
> 3 Ted
> 4 Reggie
>
> families
> family_id patient_id
> 1 1
> 1 2
> 2 3
> 2 4
>
> How do I structure the model asso
On 30 December 2010 20:34, Geo Manickam wrote:
>
>
> On Dec 30, 2:06 am, Colin Law wrote:
>> On 30 December 2010 04:32, Geo Manickam wrote:
>>
>> > I tried address still not able to display the address form.
>>
>> > <% person_form.fields_for :address do |address_form| %>
>>
>> Please don't top
Does anybody know a good way to completely customize validation
output? I've tried a number of options but can only get partway there.
For example I'd like to style not only the affected form input but
also its label, and provide a message (common to many apps). This has
been problematic, as the i
Bo Pritchard wrote in post #971530:
> Here are my tables
>
> patients
> idname
> 1 Bob
> 2 Carol
> 3 Ted
> 4 Reggie
>
> families
> family_id patient_id
> 11
> 12
> 23
> 24
>
> How do I structure the model associ
Here are my tables
patients
idname
1 Bob
2 Carol
3 Ted
4 Reggie
families
family_id patient_id
11
12
23
24
How do I structure the model associations so that I can
@patient.family.patient[0].name?
Make sense?
On Thursday, December 30, 2010 1:38:18 PM UTC-5, Rails beginner wrote:
>
> Hello
>
> I have a problem. I cant figure out how to solve this authentication
> problem with devise and i dont know if i should use a polymorphic
> association in the models or STI.
>
> I want to have 2 sign up pages. O
On Dec 30, 2:06 am, Colin Law wrote:
> On 30 December 2010 04:32, Geo Manickam wrote:
>
> > I tried address still not able to display the address form.
>
> > <% person_form.fields_for :address do |address_form| %>
>
> Please don't top post, insert your comments at appropriate points in
> the p
bourne wrote in post #971508:
>> Right. You should just be able to do Sharedtab.create :user => @user,
>> :tab => @tab...or @user.sharedtabs.create(:tab => @tab)...you get the
>> idea.
>
> Thank you so much!
>
>> And it really should be SharedTab.
>
> I noticed your comment in the last thread and
On Thu, Dec 30, 2010 at 7:59 AM, Colin Law wrote:
> On 29 December 2010 23:18, Conrad Taylor wrote:
> > ...
> > Colin, do you have a sample application? Next, it really depends
> > on your overall system and Rails app configuration. For example,
> > if you don't have enough RAM, your system mo
Hello
I have a problem. I cant figure out how to solve this authentication
problem with devise and i dont know if i should use a polymorphic
association in the models or STI.
I have 2 models like Teacher and Student. And i am trying to make a
polymorphic association.
Here is my models:
Teach
On a bare app I get the same numbers as you show in your gist (about a
2x factor for sys and real times).
On my relatively new app's specs I get these:
Using ~/.rvm/gems/ruby-1.9.2-p136 with gemset rails3
% time rake spec
real1m3.337s
user0m41.383s
sys 0m3.760s
Using ~/.rvm/gems/rub
just a couple of days ago i posted a similar q, post was titled:
what is best practice for record::notfound?the guy who answered snipped in
some code. have a look
regs
On Thu, Dec 30, 2010 at 1:02 PM, Philip Hallstrom wrote:
> > I was about to use the exception_notification plugin, and then I
> Right. You should just be able to do Sharedtab.create :user => @user,
> :tab => @tab...or @user.sharedtabs.create(:tab => @tab)...you get the
> idea.
Thank you so much!
> And it really should be SharedTab.
I noticed your comment in the last thread and will definitely change
that. Mine is Shar
On Thu, Dec 30, 2010 at 3:29 AM, dare ruby wrote:
> issing something
> >
> > Is the HTML file an ERB template that lives in the Rails views
> > directory? What web server are you using?
> >
> > -Conrad
>
> Thanks, yes its inside my views videos/list.html.erb
>
> Just using webrick for develo
On 30 December 2010 18:12, Michael Pavling wrote:
> So Eduardo, change the constant:
> SPECIAL_FEATURES = [:none, :top]
>
> ...does that do it?
>
You might also want to change the setter:
def special_feature=(value)
write_attribute(:special_feature, value.to_s.to_sym)
end
Worth a bash...
On 30 December 2010 18:04, Frederick Cheung wrote:
> On Dec 30, 5:04 pm, Eduardo Yáñez Parareda
> wrote:
>> Well, I've just tested with "none" and 'none' and I've got the same
>> error.
>>
> I think symbol/string confusion is the problem
Gah! I didn't even look at the methods... why overload the
On Dec 30, 5:04 pm, Eduardo Yáñez Parareda
wrote:
> Well, I've just tested with "none" and 'none' and I've got the same
> error.
>
I think symbol/string confusion is the problem, but not in that way.
Your setter method coerces everything to a string to clearly it
doesn't matter if you pass a str
On Thu, Dec 30, 2010 at 11:59 AM, Philip Hallstrom wrote:
> > I just created a migration which changes my default values for string and
>> text fields to empty string rather than nil.
>> >
>> > I need to update all existing records where a string or text field in
>> this table is nil. This is wha
> I was about to use the exception_notification plugin, and then I
> realized that the information it sends out could include user data (as
> a part of the exception message) which in my application is something
> we need to be careful about. I think that for my needs, an ideal
> notification syst
> > I just created a migration which changes my default values for string and
> > text fields to empty string rather than nil.
> >
> > I need to update all existing records where a string or text field in this
> > table is nil. This is what I am trying but just curious if there is a
> > better w
I was about to use the exception_notification plugin, and then I
realized that the information it sends out could include user data (as
a part of the exception message) which in my application is something
we need to be careful about. I think that for my needs, an ideal
notification system would s
On Thu, Dec 30, 2010 at 11:29 AM, Philip Hallstrom wrote:
>
> On Dec 30, 2010, at 9:10 AM, David Kahn wrote:
>
> > I just created a migration which changes my default values for string and
> text fields to empty string rather than nil.
> >
> > I need to update all existing records where a string
On Dec 30, 2010, at 9:10 AM, David Kahn wrote:
> I just created a migration which changes my default values for string and
> text fields to empty string rather than nil.
>
> I need to update all existing records where a string or text field in this
> table is nil. This is what I am trying but
hey,
Add this line in your gem file.
gem 'calendar_date_select', :git => '
http://github.com/paneq/calendar_date_select.git', :branch => 'rails3test'
and dont forgot to include default prototype.js
On Fri, Dec 17, 2010 at 11:09 PM, James Fong
wrote:
> Hi guys,
>
> I'm pretty new to the rubyon
Okay I'm making some headway but again, it's not comfortable yet.
I'm able to do the following:
(from the engine app) my_engine/config/routes.rb
MyEngine::Engine.routes.draw do
resources :test_index, :controller => 'my_engine/test_index'
end
(from the main app that uses the engine) /config/ro
David Kahn wrote in post #971487:
> I just created a migration which changes my default values for string
> and
> text fields to empty string rather than nil.
Why?
>
> I need to update all existing records where a string or text field in
> this
> table is nil.
Why?
> This is what I am trying bu
I just created a migration which changes my default values for string and
text fields to empty string rather than nil.
I need to update all existing records where a string or text field in this
table is nil. This is what I am trying but just curious if there is a better
way, I don't quite have it
Well, I've just tested with "none" and 'none' and I've got the same
error.
On 30 dic, 17:43, Michael Pavling wrote:
> 2010/12/30 Eduardo Yáñez Parareda :
>
> > Then I got this error:
>
> > Validation failed: Special feature special_feature
> > {:model=>"Model", :attribute=>"Special feature", :val
2010/12/30 Eduardo Yáñez Parareda :
> Then I got this error:
>
> Validation failed: Special feature special_feature
> {:model=>"Model", :attribute=>"Special feature", :value=>"none"} is
> not defined (ActiveRecord::RecordInvalid)!
I wonder if there's some confusion due to you assigning a symbol, b
On Dec 30, 2010, at 10:41 AM, Chris Habgood wrote:
dunno, I was asking if there was a way to get the same sort of
functionality to work.
On Thu, Dec 30, 2010 at 09:28, Marnen Laibow-Koser > wrote:
Chris Habgood wrote in post #971388:
> Is there a way to use what highlighter.com does in a ra
Hello, I have a model Model:
SPECIAL_FEATURES = %w(none top)
class Model
validates_inclusion_of :special_feature, :in =>
Model::SPECIAL_FEATURES,
:on => :create, :message => "special_feature
%s is not defined"
belongs_to :team
def special_feature
attributes = a
It appears I can still use:
Rails.application.routes.draw do
# routes
end
.. but I'd like to ensure that I do things more akin to the way the
engine code is being handled.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "
Hi all,
First, I hope everyone has a happy new year and a fun productive
programming year in 2011 with Rails!
I've been working extensively with the Rails::Engine in 3.0.3 and
decided that it was better to move to edge rails since some of the
design, especially routing, was becoming depracated in
bourne wrote in post #971468:
> My model consists of users and tasks (m:n), the relation is stored in a
> seperate table sharedtabs (that contains some extra fields).
> Between tabs and tasks there is a 1:n relation.
>
> I have trouble writing my seed.rb:
>
> works: (1)
> tab = Tab.create(:name =>
On 29 December 2010 23:18, Conrad Taylor wrote:
> ...
> Colin, do you have a sample application? Next, it really depends
> on your overall system and Rails app configuration. For example,
> if you don't have enough RAM, your system move data from memory
> to the disk and vice-versa. This is a h
My model consists of users and tasks (m:n), the relation is stored in a
seperate table sharedtabs (that contains some extra fields).
Between tabs and tasks there is a 1:n relation.
I have trouble writing my seed.rb:
works: (1)
tab = Tab.create(:name => 'Admin', :category => 0)
tab.tasks.create(
dunno, I was asking if there was a way to get the same sort of functionality
to work.
On Thu, Dec 30, 2010 at 09:28, Marnen Laibow-Koser wrote:
> Chris Habgood wrote in post #971388:
> > Is there a way to use what highlighter.com does in a rails app?
>
> Highlighted is a WordPress plugin. How wo
I solved this by adding a
post "products/add_to_cart"
to the routes.rb
-Dan
On Dec 24, 1:37 am, Dan Sadaka wrote:
> Greetings,
>
> I asked this over at the Spree google group but got no response. I'm
> hoping someone here might have experience with this.
>
> I am implementing a drag and drop
Chris Habgood wrote in post #971388:
> Is there a way to use what highlighter.com does in a rails app?
Highlighted is a WordPress plugin. How would you expect to be able to
use it in a Rails application?
Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
Sent from my iPhone
On 30 December 2010 13:51, Prasad B. wrote:
> i have a registration form ,i want to store data in corresponding user
> table in that hobbies field
> ,i want to store all hobbies in one column so i take multiple check
> boxes and store in one array
At the risk of making the the thread start soundi
On Thu, Dec 30, 2010 at 7:59 AM, Greg Ma wrote:
> Frederick Cheung wrote in post #971451:
> > On Dec 30, 1:40pm, Greg Ma wrote:
> >> Hi,
> >> Is it possible to know in a callback to know which attributes were
> >> updated?
> >> I want to do stuff only if one attribute has been updated.
> >>
> >
dare ruby wrote in post #971437:
> issing something
>>
>> Is the HTML file an ERB template that lives in the Rails views
>> directory? What web server are you using?
>>
>> -Conrad
>
> Thanks, yes its inside my views videos/list.html.erb
>
> Just using webrick for development..
Would it be a l
On 30 December 2010 13:51, Prasad B. wrote:
I am assuming that this is in response to my post, but again you have
not quoted the previous message so I do not know. When replying
please insert your reply into the previous message so that it is
easier to follow the thread. Thanks
> i have a regi
Frederick Cheung wrote in post #971451:
> On Dec 30, 1:40pm, Greg Ma wrote:
>> Hi,
>> Is it possible to know in a callback to know which attributes were
>> updated?
>> I want to do stuff only if one attribute has been updated.
>>
> The changed and changes methods lists changed attributes. There ar
On Dec 30, 1:40 pm, Greg Ma wrote:
> Hi,
> Is it possible to know in a callback to know which attributes were
> updated?
> I want to do stuff only if one attribute has been updated.
>
The changed and changes methods lists changed attributes. There are
also invididual predicate methods, eg name_c
i have a registration form ,i want to store data in corresponding user
table in that hobbies field
,i want to store all hobbies in one column so i take multiple check
boxes and store in one array
all checked values for that i am using below tag,but not working,please
any suggestion
<%= check_box(:
On 30 December 2010 13:39, Prasad B. wrote:
> please it is urgent for me any suggestion urgent
Since you have not quoted any previous message it is not clear what
you are wanting help with.
Looking back at your original post it is not clear exactly what you
are having difficulty with. I assume y
Hi,
Is it possible to know in a callback to know which attributes were
updated?
I want to do stuff only if one attribute has been updated.
Greg
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
T
please it is urgent for me any suggestion urgent
--
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 unsubscribe from this
Hi. I am learning Ruby on rails and i would like to use Netbeans for
editor. I want to use Ruby 1.9.2 -p0 for platform. when i create i
project i would like to use sqlserver adaptetr. How can i install
sqlserver adapter in Netbeans so i can select it from the "Specify
Database Information Directly
Hi,
I am new to rubyonrails..i have some dought using select tag.
I created two tables with name of districts and taulks..both table
have id and name.I load all data from districts table
view:
<% select ("districts" , options_for_select(@all)) %>
controller:
@all = District.find(:all)
now i want
issing something
>
> Is the HTML file an ERB template that lives in the Rails views
> directory? What web server are you using?
>
> -Conrad
Thanks, yes its inside my views videos/list.html.erb
Just using webrick for development..
--
Posted via http://www.ruby-forum.com/.
--
You received
Sent from my iPhone
On Dec 30, 2010, at 1:49 AM, dare ruby wrote:
> Conrad Taylor wrote in post #971410:
>> On Wed, Dec 29, 2010 at 9:39 PM, dare ruby wrote:
>>
>>> also,
>>> Also for your reference when i tried to run like,
>>>
>> Dare, I was able to put together Rails 3.0.3 application us
Hi Conrad,
> add it to your Gemfile as follows:
> gem "redgreen"
I just tried this again and received the original error which prompted
the workaround a couple of weeks ago:
no such file to load -- test/unit/ui/console/testrunner
Based on reading at the time it seemed to be related to depende
On 30 December 2010 04:32, Geo Manickam wrote:
> I tried address still not able to display the address form.
>
>
> <% person_form.fields_for :address do |address_form| %>
Please don't top post, insert your comments at appropriate points in
the previous message. It makes it easier to follow the
Conrad Taylor wrote in post #971410:
> On Wed, Dec 29, 2010 at 9:39 PM, dare ruby wrote:
>
>> also,
>> Also for your reference when i tried to run like,
>>
> Dare, I was able to put together Rails 3.0.3 application using Ruby
> 1.9.2
> without any issues. Furthermore, I didn't have to play with m
I've tried this too.
I get when I run "rake test"
/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.3/lib/active_support/
dependencies.rb:239:in `require': no such file to load -- redgreen
(LoadError)
The gem is definitely installed:
mongoid (2.0.0.beta.20)
mynyml-redgreen (0.7.1)
mysql (2.8.1)
Hi,
I have a model name called 'Address' with 4
column(id,code,details,active).
Here i declared
set_primary_key :code.
and map these code to others table(association) and id is serial.
now i am not able to create new record for address(giving input for
code, details, active).
i am getting below
69 matches
Mail list logo