Hi Daniel
Thanks for helping :-)
This is exactly how I was thinking it should work. But I just tried
using set_table_name and I still got the same result, for example, using
your code (which is exactly what I'd love to do), I get this:
w = Worker.create(:name = WorkerName) # ok
p =
On 13 September 2010 21:57, Daniel Gaytán daniel.gaytan.n...@gmail.comwrote:
Then it may be set as resource instead of resources
or maybe
resources :something, :except = :destroy do
delete :destroy, :on = :collection, :as = :destroy
end
If I do
resources :sessions, :except =
I tried to get acts_as_attachment. All I get from the website is the
link list below.
http://svn.techno-weenie.net/projects/plugins/acts_as_attachment/
This link seems not availiable now. Does anyone know about other URL for
this plugin?
thanks in advance.
--
Posted via
A dataset I'm working with has bad dates in it (2010-00-09 for
example). This causes Mysql2 to throw an error at the adapter level.
How am I supposed to catch it so I can handle it correctly? I don't
think it fails in ActiveRecord land, so I'm not sure how to handle it.
I figured since Rails 3
On 14 September 2010 09:14, Mauro mrsan...@gmail.com wrote:
On 13 September 2010 21:57, Daniel Gaytán daniel.gaytan.n...@gmail.com
wrote:
Then it may be set as resource instead of resources
or maybe
resources :something, :except = :destroy do
delete :destroy, :on = :collection, :as
This plugin is now renamed as Restful authentication, available at
http://github.com/technoweenie/restful-authentication
On Sep 14, 12:20 pm, Edwin Chen li...@ruby-forum.com wrote:
I tried to get acts_as_attachment. All I get from the website is the
link list
On 13 September 2010 19:54, Jeff cohen.j...@gmail.com wrote:
On Sep 13, 6:10 am, Frederick Cheung frederick.che...@gmail.com
wrote:
On Sep 13, 11:59 am, PalaniKannan K kpalanikan...@gmail.com wrote:
Hi,
select * from table1 inner join table2 on table1.foreign_key =
table2.foreign_key
On 14 sep, 07:11, Robert Rouse robert.e.ro...@gmail.com wrote:
I know I could fix the data, but I'm not sure when/if another batch
will come in like that and I want to make sure my app is bulletproof.
Seems like you should fix the data, and add validations to ensure that
bad data doesn't get
radhames brito wrote:
sorry i meant to say
you can put normal tags in it i have and is works.
i want to add more html to the select field.
like to buttons to add and remove from the select field.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are
hi erevy one
i use ruby 1.8.7 ,rails is 2.2.2
fisrt get the latest source distribution of Ruby-DBI from:
http://rubyforge.org/projects/ruby-dbi/ and copy the file:
rub-DBI is 0.2.2
lib/dbd/ADO.rb
to:
X:/ruby/lib/ruby/site_ruby/1.8/DBD/ADO/ADO.rb
then i install
gem install
I have a website that is working fine, except I cannot get it to print
out characters other than plain text. Characters such as ', :, and
others like degrees print with the dreaded black diamond with a ?
inside.
Anyone has any idea as to how I might overcome this.
I want to have my website
Can I do something like that?
resources :rusers do
resources :deliveries
resources :doc_details
end
Or it is best to do:
resources :rusers do
resources :deliveries
end
resources :rusers do
resources :doc_details
end
--
You received this message because you are subscribed to
Martin...
It would be more helpful to me if you were to actually describe what
you are talking about.
If what you are saying is override initialize like so:
pre
Class Recipe ActiveRecord::Base
def initialize (name, yield_amount, yield_unit)
self.unit_type = get_unit_type(yield_unit)
with cancan, in your ability model
can :manage , Proyect do |proyect|
proyect.user = current_user
end
with this only the proyect's owner is an admin of the proyect
and i suggest you create model with the role model gem, there really is no
need for a role table.
On Tue, Sep 14, 2010 at
Post. module is not the same as i.module, i is an instance of the Post
class that means you can do
Post.name == i.class.name and returns true.
acording to ruby docs this is what a module is
A Module http://ruby-doc.org/core/classes/Module.html is a collection of
methods and constants
there is a plugin to make formtastic work with calendar_date_select go and
check the code of the plugin since it does what you want.
i bet you can figure out how to do it by checking it out.
On Tue, Sep 14, 2010 at 5:33 AM, Jamal Soueidan li...@ruby-forum.comwrote:
radhames brito wrote:
Of course, I should have known that :method was for the HTTP method.
Thanks.
I guess i just need to write the correct routes now.
On Sep 14, 4:28 pm, Srikanth Shreenivas sri...@gmail.com wrote:
Reference on link_to
try using bundler to install the gem , it will try to find all the
dependencies.
http://railscasts.com/episodes/201-bundler
On Tue, Sep 14, 2010 at 6:08 AM, Deng Bin li...@ruby-forum.com wrote:
hi erevy one
i use ruby 1.8.7 ,rails is 2.2.2
fisrt get the latest source distribution of
this works
resources :rusers do
resources :deliveries
resources :doc_details
end
but watch this to clear everything up
http://railscasts.com/episodes/203-routing-in-rails-3
http://railscasts.com/episodes/231-routing-walkthrough
On Tue, Sep 14, 2010 at 6:54 AM, Mauro
Jon Seidel wrote:
Martin...
That's not my name. Look again.
It would be more helpful to me if you were to actually describe what
you are talking about.
I did. If you don't know what a constructor is, then you need to review
your basic Ruby in order to use Rails effectively.
If what
Am working my way through the railstutorial.org lesson at
http://railstutorial.org/chapters/filling-in-the-layout#top
Am not clear about how to start the autotest, and when I tried to see
the above page in the broswer, I got this error:
Last login: Tue Sep 14 17:06:38 on ttys000
Am working my way through the railstutorial.org lesson at
http://railstutorial.org/chapters/filling-in-the-layout#top
Am not clear about how to start the autotest, and when I tried to see
the above page in the broswer, I got this error:
Last login: Tue Sep 14 17:06:38 on ttys000
David Kahn wrote:
[...]
And why are you using RSpec specs for your controllers, anyway?
Cucumber stories are better for that. RSpec is better for model logic.
Well, I was hoping to cap new things on this project with Rails 3, ruby
1.9.2, rspec, factory girl.
Uh, what? If you need a
f.select :attr, @choices, :include_blank = true,
:disabled = !...@condition
f.select :attr, @choices, {:include_blank = true},
:disabled = !...@condition
f.select :attr, @choices, {:include_blank = true},
{:disabled = !...@condition}
I remember struggling with this a while
Don Mapp wrote:
I have a website that is working fine, except I cannot get it to print
out characters other than plain text.
*Any* character is plain text.
Characters such as ', :, and
others like degrees print with the dreaded black diamond with a ?
inside.
Then your actual encoding is
Pål Bergström wrote:
def crypt_data
self.name = Crypto.encrypt(self.name,key)
end
def decrypt_data
self.name = Crypto.decrypt(self.name,key)
end
Are you sure you don't mean @name? This is Ruby, not Python, so self
would generally refer to the class or module, not the object.
On Tue, Sep 14, 2010 at 08:47, pauld paul.denlin...@gmail.com wrote:
Am working my way through the railstutorial.org lesson at
http://railstutorial.org/chapters/filling-in-the-layout#top
Am not clear about how to start the autotest, and when I tried to see
the above page in the broswer, I
Dave Aronson wrote:
P�l Bergstr�m wrote:
def crypt_data
� � �self.name = Crypto.encrypt(self.name,key)
end
def decrypt_data
� � �self.name = Crypto.decrypt(self.name,key)
end
Are you sure you don't mean @name? This is Ruby, not Python, so self
would generally refer to the class or
Pål Bergström wrote:
I pass a value from controller to model with attr_accessor. before_save
works fine but not after_find. What could be wrong?
Note this sentence from the documentation:
Unlike all the other callbacks, after_find and after_initialize will
only be run if an explicit
Edwin Chen wrote:
I tried to get acts_as_attachment. All I get from the website is the
link list below.
http://svn.techno-weenie.net/projects/plugins/acts_as_attachment/
This link seems not availiable now. Does anyone know about other URL for
this plugin?
thanks in advance.
I think most
Sorry, Marnen...
Anyway, as I mentioned before, after_create is way too late in the
sequence of things to do any good and after_initialize is recommended
against (as is after_find) because of performance reasons.
I believe I know what a constructor is, so your snide comments
continue to be of
Hi, very briefly, this is my interaction in debugger mode in a
controller test. I have my test where I initialize some cookies, but
then the test itself, when the controller action is executed, fails
because even though the cookies are properly set, when accessing them
i always get nil. Not sure
Hi all,
ROR newbie coming from a PHP background here.
I have a model that inherits from ActiveRecord::Base. I would like to
extend that into two further models, to separate functionality from
each other. Basically:
class Person ActiveRecord::Base
attr_accessible :gender
end
class Male
attachment_fu is the successor of acts_as_attachment.
http://github.com/technoweenie/attachment_fu
You should also have a look at paperclip.
http://github.com/thoughtbot/paperclip
On Sep 14, 9:20 am, Edwin Chen li...@ruby-forum.com wrote:
I tried to get acts_as_attachment. All I get from the
I think you meant acts_as_authenticated.
On Sep 14, 9:46 am, Gcompany saurabh.a.bha...@gmail.com wrote:
This plugin is now renamed as Restful authentication, available
athttp://github.com/technoweenie/restful-authentication
On Sep 14, 12:20 pm, Edwin Chen li...@ruby-forum.com wrote:
I
Hello All,
I have a requirement where a site needs to have a Super User and exactly
one of those could be created.
The flow would be like this
- User installs the app
- the web app comes up
- the first thing that the webapp does it to prompt creation of super user.
- the super user is logged in
Please quote when replying! It's impossible to follow the discussion if
you don't.
Jon Seidel wrote:
Sorry, Marnen...
Anyway, as I mentioned before, after_create is way too late in the
sequence of things to do any good and after_initialize is recommended
against (as is after_find)
On Sep 14, 11:31 am, moonshadow equestrian...@gmail.com wrote:
How can I write a method within Person that will detect what gender
has been defined and return the proper object based on it?
I'm thinking something like...
def self.new
gender_class = self.gender == 'Female' ? 'Female' :
moonshadow wrote:
Hi all,
ROR newbie coming from a PHP background here.
I have a model that inherits from ActiveRecord::Base. I would like to
extend that into two further models, to separate functionality from
each other. Basically:
class Person ActiveRecord::Base
attr_accessible
On Tue, Sep 14, 2010 at 09:44, Marnen Laibow-Koser li...@ruby-forum.com wrote:
That's not true. In an instance method, self refers to the object.
Oops, you're right, on further research it seems to be a slippery
little bugger. No wonder I usually see people using @ (or @@)
instead
-Dave
Dave Aronson wrote:
On Tue, Sep 14, 2010 at 09:44, Marnen Laibow-Koser
li...@ruby-forum.com wrote:
That's not true. �In an instance method, self refers to the object.
Oops, you're right, on further research it seems to be a slippery
little bugger.
Not slippery at all. It's very well
Also,
check whether using html escaping helps:
%= *h* @picture.description %
On Tue, Sep 14, 2010 at 6:31 PM, Marnen Laibow-Koser
li...@ruby-forum.comwrote:
Don Mapp wrote:
I have a website that is working fine, except I cannot get it to print
out characters other than plain text.
I've noticed that if I use the numericality validator and the user
enters, for example 1234ABCD it'll come back with a not a number
error, but it then fills the input box with 1234, discarding the non-
numeric input the user originally put in.
I've seen a similar question about this in this
Hi,
When updating a ReferralProgram object that has nested Pages in it I
get the error in the subject line.
Rails generates parameters that look like this:
{pages_attributes={0={body=blabla,
subject=blabla,
id=1}}}
When the id parameter is removed like this:
This works, as far as finding both workers and managers for any given
task. All CRUD look good.
I also need to sort on either the worker name or the manager name, or
both. I can't make this work, since there is no actual field named
worker.name, for example.
My code looks like
Hi guys
any advice about hosting for Rails 3 ? I will need to use a search engine
like Sunspot / Solr
Heroku ?
Slicehost ?
Rackspace ?
advice will be appreciated.
thanks.
-- Aldo
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To post
Srikanth Shreenivas wrote:
Also,
check whether using html escaping helps:
%= *h* @picture.description %
It won't. That's not the issue.
Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you
Rackspace
2010/9/14 Aldo Nievas aldo.nie...@satio.com.ar
Hi guys
any advice about hosting for Rails 3 ? I will need to use a search engine
like Sunspot / Solr
Heroku ?
Slicehost ?
Rackspace ?
advice will be appreciated.
thanks.
-- Aldo
--
You received this message because you are
Aldo Nievas wrote:
Hi guys
any advice about hosting for Rails 3 ? I will need to use a search
engine
like Sunspot / Solr
Heroku ?
Slicehost ?
Rackspace ?
advice will be appreciated.
I should think any of those would be fine, unless Sunspot won't work on
Heroku.
thanks.
-- Aldo
Hello Javier
I don't know what would happen, I installed rails 2.3.9 to try the same code
I wrote in rails 3 and worked like a charm.
There is something weird in your code since the table name for Person model
should be People... I don't know if there is a problem with your
ActiveRecord or
Thanks for the reply. In the example above I'm not sure where the
Admin variable is located? Is that in the User's table as a boolean?
The reason for a roles table is that there will be multiple roles
(Admin, Member, Viewer, Guest) etc...
I tried finding the role model gem but it didn't come up
Michael Schuerig wrote:
with_locale(:en) {
Page.find_by_name('Welcome')
}
Thanks, but there's a little something that makes me not being able to
use it. I got another field called content which has the actually
content of the page. When I use it with with_locale I get the english
content
http://github.com/martinrehfeld/role_model
Enjoy!
Daniel Gaytán
2010/9/14 nobosh bhellm...@gmail.com
Thanks for the reply. In the example above I'm not sure where the
Admin variable is located? Is that in the User's table as a boolean?
The reason for a roles table is that there will be
%= f.select :attr,
@choices,
{},
:include_blank = true,
:disabled = !...@condition %
It just happens that I'm working on the very same thing again and the
problem with the above is that when the select is not
Thanks Marnen, I did take your prod and got Cucumber working it was a
great day, I think cucumber may even be a bigger win for me than rspec in
terms of productivity.
On Tue, Sep 14, 2010 at 7:49 AM, Marnen Laibow-Koser
li...@ruby-forum.comwrote:
David Kahn wrote:
[...]
And why are you
Awijeet Mr. wrote:
How can I enable my admin to index the tables, just after he/she makes
change into database.
The database should take care of its own indexing. Your application
normally does not need to worry about this once the indices are set up.
Or am I misunderstanding your question?
this is very easy , but now im busy at work ill post some suggestions in
about 3 hours is no one answers
On Tue, Sep 14, 2010 at 9:07 AM, Manish Chakravarty
manishch...@gmail.comwrote:
Hello All,
I have a requirement where a site needs to have a Super User and exactly
one of those could be
role model is a gem that lets you add roles to the user as a method and
saves the role into a field on the user table as a bitmask
that is , lets say you have and array like this
ROLES = %w[admin moderator author banned]
this gord in your user model and you have a field in the user table
called
I am trying to send data from a remote file attachment
---
attachment['url'] = http://www.mydomain.com/resource/download/54643;
I wrote a class RemoteFile ::Tempfile to fetch to remote data
--
remote_file = RemoteFile.new(attachment['url'] )
so, I get a tempfile
I'm new to ruby on rails and am using active record 3 to create some
object models on top of a postgres db.
I have an Environment record with a :name attribute that maps to the
:name column of type :string. When I do Environment.find_by_name( abc
), everything works as expected. However, when I
oops got confused with full text indexing i thought you where talking about
sphinx or something like it
On Tue, Sep 14, 2010 at 12:46 PM, Marnen Laibow-Koser
li...@ruby-forum.comwrote:
Awijeet Mr. wrote:
How can I enable my admin to index the tables, just after he/she makes
change into
On 14 September 2010 16:20, Brian Ablaza li...@ruby-forum.com wrote:
My code looks like
Task.find(:all, :order = worker.name, manager.name)
Since both workers and managers are actually in the Person table, I
can't see how this could work.
Try :
Task.find(:all, :include = [:worker,
I am trying to send data from a remote file attachment
---
attachment['url'] = http://www.mydomain.com/resource/download/54643;
I wrote a class RemoteFile ::Tempfile to fetch to remote data
--
remote_file = RemoteFile.new(attachment['url'] )
so, I get a tempfile
Thanks guys.
I will go for Rackspace Cloud option.
-- Aldo
On Tue, Sep 14, 2010 at 12:31 PM, Marnen Laibow-Koser
li...@ruby-forum.comwrote:
Aldo Nievas wrote:
Hi guys
any advice about hosting for Rails 3 ? I will need to use a search
engine
like Sunspot / Solr
Heroku ?
I have a resource whose public ID is a URL. The resulting URLs look like
this
http://my-app.com/things/http%3A%2F%2Fexample%2Ecom/foo.png
I make sure manually, that . in URLs are encoded as %2E. The route
looks like this
get 'things/:url' = 'things#show'
This works just fine with
Guys, I appreciate the replies but I'm not trying to assign roles to
users.
Users can join projects, and users have roles per project
Examples:
User X belong to Project A with an Admin Role
User X belong to Project B with an Guest Role
User Y belong to Project B with an Observer Role
Does that
On 14 September 2010 19:25, nobosh bhellm...@gmail.com wrote:
Guys, I appreciate the replies but I'm not trying to assign roles to
users.
Users can join projects, and users have roles per project
I understand what you mean, but can't suggest a solution that I've
done myself (as I've tended to
nobosh wrote:
Guys, I appreciate the replies but I'm not trying to assign roles to
users.
Users can join projects, and users have roles per project
Examples:
User X belong to Project A with an Admin Role
User X belong to Project B with an Guest Role
User Y belong to Project B with an
radhames brito wrote:
role model is a gem that lets you add roles to the user as a method and
saves the role into a field on the user table as a bitmask
that is , lets say you have and array like this
ROLES = %w[admin moderator author banned]
this gord in your user model and you have a
On Thu, Sep 9, 2010 at 3:04 PM, Len Smith ignu.sm...@gmail.com wrote:
macvim can be prettier and much more powerful than textmate, and you get the
advantage of learning vim and being able to leverage its power on any server
you're on.
I've been working diligently to 'really try' to use MacVim
That's the big problem I'm having with MacVim for Rails.. it just ends
up not polished enough. For example I'm using the following plugins:
rails plugin, NerdTree, FuzzyFinderTextMate, BufferWipe, and bufmru,
and things are just awkward sometimes. For example if I'm in the
NerdTree pane and I
Hi Marnen, thanks I think that's great. The question is now will
CanCan Support that? Are you familiar with CanCan?
Something like... (ability.rb)
def initialize(user)
user ||= User.new
if user.role? :super_admin
.
.
end
user.rb
def role?(role)
return
On Tue, Sep 14, 2010 at 11:13 AM, Michael Schuerig mich...@schuerig.de wrote:
I have a resource whose public ID is a URL. The resulting URLs look like
this
http://my-app.com/things/http%3A%2F%2Fexample%2Ecom/foo.png
I make sure manually, that . in URLs are encoded as %2E. The route
looks
acuitycorp wrote:
Hi there,
We're a startup looking. A good usage model of our site is something
like the travel site Kayak. Lots of searching of database with
stale price data, with live crawling of many sites (for lower
prices), and various different views of information - a product
few thoughts... I've been a ColdFusion dev for years and finally
decided to make the move to something better. I actually started with
Django, Google's App engine, a few recommendations from friends lured
me in. After about 2 weeks I got pretty fed up with Django + App
Engine, mainly bec the
Please quote when replying; otherwise, the discussion is hard to follow.
nobosh wrote:
Hi Marnen, thanks I think that's great. The question is now will
CanCan Support that?
I have no idea.
Are you familiar with CanCan?
No. I've generally used rails_authorization or rolled my own
On Sep 13, 7:05 pm, Awijeet Mr. li...@ruby-forum.com wrote:
How can I enable my admin to index the tables, just after he/she makes
change into database.
Just create new controller and execute in index action a sql statement
that will return list of database tables. With that you will have live
On Tue, Sep 14, 2010 at 3:08 PM, Rimantas Liubertas riman...@gmail.comwrote:
Try Command-T:
http://www.vim.org/scripts/script.php?script_id=3025
Much better thanks! (Once I figured out it had to be compiled against ruby
1.8.7 :)
--
Rick R
--
You received this message because you are
radhames brito wrote:
you site crashed because the comment on the page article are found by
pulling the article_id from the params but you want to add childrens to
a
comment and there is no way to pull that id with the find_commentable
function
I am having trouble following you. I have to
On Tuesday 14 September 2010, Jeremy Kemper wrote:
On Tue, Sep 14, 2010 at 11:13 AM, Michael Schuerig
mich...@schuerig.de wrote:
[...]
There is nothing in the app's log. The problem appears to be caused
by the / in the :url parameter, even though they are encoded as
%2F.
I'd prefer if
I am about 1.5 years in to rails and have to say even with catching up with
the changes on 3.0, the tools and way of thinking of this community is a
reason why I am still writing code and excited because for some reason here
on rails even when I hit problems I know there is light at end of tunnel
Thanks Philip, this is better .. it seems a little bit more
complicated that I thought
I need to get a file that I download from this url this not the
file url, but an html page to download the file
attachment['url'] :: http://www.pivotaltracker.com/resource/download/
579633
and then pass
In my app, I have an URL to download a file from a remote site , when
using this URL in a browser I download the file...
http://www.anotherdomain.com/resource/download/579633;
but I need to to get the content of this file within my app , as I
must encode it and transfer to another app
if I use
Where is this functionality moved to for Rails 3? I assume I'm no
longer supposed to script/install this...
More importantly, how should I have been able to figure this out on my own?
--
Luke
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk
Hello every body , i am new in this group and so happy to find a RoR
group on the net .
I work in some projects in ROR like a web application to administrate
the iptables layer on Linux :)
I wish that I'm welcome here :)
--
You received this message because you are subscribed to the Google
I am using ruby 2.35. I do not think that that will matter.
On Sep 14, 3:57 pm, Srikanth Shreenivas sri...@gmail.com wrote:
Also,
check whether using html escaping helps:
%= *h* @picture.description %
On Tue, Sep 14, 2010 at 6:31 PM, Marnen Laibow-Koser
li...@ruby-forum.comwrote:
Don
html escaping makes no difference. I have other pages with escaping
set and the problem is the same.
On Sep 14, 4:25 pm, Marnen Laibow-Koser li...@ruby-forum.com wrote:
Srikanth Shreenivas wrote:
Also,
check whether using html escaping helps:
%= *h* @picture.description %
It won't.
In time I will re-write in html 5, but when I originally wrote the
website years ago I do not think 4 0r 5 was available.
On Sep 14, 3:57 pm, Srikanth Shreenivas sri...@gmail.com wrote:
Also,
check whether using html escaping helps:
%= *h* @picture.description %
On Tue, Sep 14, 2010 at 6:31
Thanks.
I missed that with all the commented out information.
Paul Denlinger
On Sep 14, 9:42 pm, Dave Aronson googlegroups2d...@davearonson.com
wrote:
On Tue, Sep 14, 2010 at 08:47, pauld paul.denlin...@gmail.com wrote:
Am working my way through the railstutorial.org lesson at
Welcome to the world of RoR!!!
On Tue, Sep 14, 2010 at 8:01 PM, abdelkarim abdou@gmail.com wrote:
Hello every body , i am new in this group and so happy to find a RoR
group on the net .
I work in some projects in ROR like a web application to administrate
the iptables layer on Linux
Kad Kerforn wrote:
In my app, I have an URL to download a file from a remote site , when
using this URL in a browser I download the file...
http://www.anotherdomain.com/resource/download/579633;
but I need to to get the content of this file within my app , as I
must encode it and
Greetings,
I have my rails 3 newly installed, everything seemed working except I
tried start thin server:
~/test/rails3_1.9$ script/rails server thin
Exiting
/var/lib/gems/1.9.1/gems/rack-1.2.1/lib/rack/handler/thin.rb:1:in
`require': no such file to load -- thin (LoadError)
from
I hope I am not saying something totally wrong and idiotic but here goes: Is
that Ruby 1.9.1 you are using? If I understand Rails 3 wants either 1.8.7 or
1.9.2. Could that be the problem?
On Tue, Sep 14, 2010 at 10:12 PM, Difei Zhao li...@ruby-forum.com wrote:
Greetings,
I have my rails 3
try to fix the thing i suggested in red and add a parent_id field to the
comments table,
then make a self referencial associaction or use the acts_as_tree gem, the
thing is along with
the polimorphic fields a comment should be able to belong to another
comment, when you try to make a comment
if you put a field called type in the table of the base class AR will
automaticly save to the correct class, in fact from that moment on
everything will behave as is you had 2 models, no need for more
configuration.
On Tue, Sep 14, 2010 at 10:20 AM, Frederick Cheung
frederick.che...@gmail.com
Why ? i dont see a problem in the case of roles
On Tue, Sep 14, 2010 at 2:46 PM, Marnen Laibow-Koser
li...@ruby-forum.comwrote:
radhames brito wrote:
role model is a gem that lets you add roles to the user as a method and
saves the role into a field on the user table as a bitmask
that is
Marnen, in your example models above, permissions is the name of the
table correct? that I create?
I ended up calling it: projects_users_roles
class ProjectsHaveAndBelongToManyUsersWithRoles
ActiveRecord::Migration
def self.up
create_table :projects_users_roles, :id = false do |t|
Kad Kerforn wrote:
In my app, I have an URL to download a file from a remote site , when
using this URL in a browser I download the file...
http://www.anotherdomain.com/resource/download/579633;
but I need to to get the content of this file within my app , as I
must encode it and
oh is very easy with cancan and the wiki has eveything you need
i recommend making the is() function that says the wiki
there are 2 easy ways to set a permission with cancan
one is the general way
if user.is(:guest) can :read, Article
this means that gues user can read articles, all of them
moonshadow wrote:
def self.new
gender_class = self.gender == 'Female' ? 'Female' : 'Male'
eval(gender_class).new
end
Really, look into how ActiveRecord handles STI by using the type column.
It will handle all of this for you.
That said, the way to do something when an object is created
1 - 100 of 113 matches
Mail list logo