similar to: include vs extend

Displaying 20 results from an estimated 7000 matches similar to: "include vs extend"

2008 Jun 25
2
How to escape from the before_filter for the particular acti
Hi, We use the following code in the ApplicationController. before_filter :login_required Iam aware, this will be called for every action. How to escape for the particular action? Thanks, Ayyanar. A -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2007 Dec 04
2
button_to_function question
Hey everybody, I am trying to create a button that, when clicked on, calls a method in a controller then changes the image on the button without a page load. I was thinking that button_to_function might be a good contender for this but I don''t yet know how to make it talk to a controller, and on success change the image of the button. Can anyone help me out with this problem? Thanks,
2008 Jan 13
2
module_eval and scope question
When trying to understand a piece of code from the Ruby-On-Rails framework, I found that I''m still lacking knowledge about scope issues in Ruby. Here is a stripped down version of the code I''m trying to understand (in case you happen to use Rails: This is from file scaffolding.rb): module ActionController module Scaffolding .. module ClassMethods def
2012 Sep 11
1
define_method vs module_eval
Rails code: Accessors.send :define_method, :"default_#{name}", &block Accessors.module_eval <<-METHOD, __FILE__, __LINE__ + 1    def #{name}    -ISKimRw02aC5oVgD8gxYQQ@public.gmane.org(:#{name}, [])    end    def #{name}=(value)    value = value.present? ? Array(value) : default_#{name}    _set_detail(:#{name}, value) if value != @details[:#{name}]    end  
2006 Mar 13
1
adding custom cache field
Hello, I needed to add custom cache field for one of my application. I thought I will share the code showing how to do this. This code below creates and maintain a custom cache field, for keeping track of totals. Say, you have accounts, and for each account there are transactions (either deposit/withdrawal), and one will like to keep track of the total balance for an account. So, let there be a
2006 Jul 23
8
belongs_to :through ?
Suppose I have a belongs_to relationship and the thing it belongs to, belongs in turn to something else. For example, I would like to do: belongs_to :city belongs_to: :county, :through => :city While it is not too much trouble to do obj.city.county, there are times when I need to iterate through the attributes and include this second-order attribute. Special code to handle this messes up
2006 Jul 22
1
How to debug this
Hello,I get this message and I don''t know how to interprete this.I think it has to do with plural tables and singular referencesThanks for any help!Jim======================================================================================uninitialized constant SubjectRAILS_ROOT: ./script/../config/.. Application Trace | Framework Trace | Full Trace
2006 Jan 09
1
Cooky Cookies
Hi All, I have a problem with the stemming(?) in rails. I have a table cookie and a Cookie model which I have generated a scaffold for. The problem is that rails starts looking for a file that it calls "cooky.rb", this must be some kind of misunderstanding between me and rails, but how do I correct it? Other scaffolds work just fine. /Hugo NameError in Cookie#index uninitialized
2006 Jul 26
1
Scaffolding Problems
Hi.. Im a brand new ruby on rails developer, and when i make a scaffold and navigate to the it, i get an error that looks like this. ----------------------------------------------------------------- NameError in PagesController#list uninitialized constant Page RAILS_ROOT: ./script/../config/.. Application Trace | Framework Trace | Full Trace
2006 Jan 10
1
Cooky cookies causes trouble
Hi All, Yesterday wrote about my troubles with naming a table and model cookies and cookie respectively. I know that everybody hates the newbie screaming bug as soon as he encounters behaviour he doesn''t understand. But I''ve reproduced the error in the simplest application possible, and dare therefore say that this quite possible could be a bug in Rails. Database: CREATE TABLE
2011 Apr 08
5
How to extend a helper using plugin?
Hello, I''m facing this problem while trying to extend the parse_redmine_links helper method in Redmine-1.1.0 (Rails-2.3.5) from my plugin. My idea is to use alias_method_chain so the extended version could call the original version and adjust the result to it''s liking. Anything I''ve tried so far exposes this behavior: the first render of a page uses the extended
2006 Jun 14
5
uninitialized constant error after scaffold on new Windows XP environment
I am attempting to get a working Rails programming environment setup working under XP with MySQL, RadRails and Webrick. I have been using my PowerBook but need to working on Windows environment too. I have basic functions of Ruby and Rails going. I created a really simple table and generated the scaffolding. The server starts just fine. I can browse the database succesfully in RadRails. The issue
2008 Feb 19
32
storing SOM epoch in EA
Good day, some time ago we discussed that it would be very helpful to store epoch in inode on mds. the perfect solution could be to store epoch in old inode body, but there is no much space for this in the body and with DMU we''ll have this problem again. given the minimal inode size we use on MDS is 512 bytes, we can store upto 13 stripes in the body. larger EAs go to a dedicated block.
2005 Dec 21
1
Table called applications - causes stack overflow?
Having worked through Four Days on Rails and the book Agile Web Development with Rails I decided it was time to start a live project. I have an existing application with MySQL database, so I modified the schema to use Rails standard column names. The main table was named ''applications''. ruby script/generate scaffold Application Admin results a stack overflow
2006 Mar 03
6
has_one :next - invalid name?
I have this in a model: has_one :next, :class_name=>''WorkPart'', :foreign_key=>''next_id'' And it causes this error: compile error /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/deprecated_associations.rb:83: void value expression
2009 Jan 15
23
Aspire One?
alright, i think i installed wine on my new aspire one, the problem is, i used the root, yum wine way, is this how you install it? also, i want to make sure it does work with the aspire one (that uses linpus, fedora based)? and then after i installed wine, i tried to install a game, which i then tried to load up and it didnt work, is there a special way of installing games through wine? ok,
2005 May 10
3
Packets going to default class iam having still the problem
Hi all Its been long time i have sending this message to this news group but i could not get proper responce from the authors or any experts that, is that bug or only the problem with my ssytem iam tryin this config with FC iptable 1.3.0 and latest TC tc utility, iproute2-ss050330 htb 3.17 iam trying past 2 weeks and digging all googles but could not able to come to conclusion whats wrong
2005 Aug 23
4
isolinux 3.10-pre20 doesn't work at all
I tried isolinux 3.10-pre20 on an Acer Aspire 1501LMi notebook and a Shuttle FS-40 desktop box; it fails on both, simply hanging after printing the first line. Last known good version is 3.10-pre16; will try pre17-pre19 when I have some time.
2008 Mar 16
3
Problems to get booting Flashkey
Hello List, iam following to this howto: http://www.sysresccd.org/Sysresccd-manual-en_How_to_install_SystemRescueCd_on_an_USB-stick but when iam try the command: # syslinux /dev/sda1 it writes only into the FAT partition the files they need, but mbr still is empty after. iam do this: # dd if=/dev/sda of=/tmp/mbr.dd bs=512 count=1 and open it with ghex2 in my case and see only the partition table.
2016 Jun 20
6
netbook screen suddenly goes black
Hi all! I'm running an up to date Centos-7 on my Acer Aspire One netbook. have been for, well, ever since C7 was released. Just had an event today that also happened 2 or 3 times with earlier systems installed, but I never pursued it. What happens is that suddenly while working away on the desktop the display suddenly goes black... not black as in turned off, I can see that the backlight is