Displaying 20 results from an estimated 100 matches similar to: "Mixin variables"
2007 Oct 16
6
Failure trying to test ApplicationController
I''m trying to write some tests for the ApplicationController as shared
tests that can be run in all of my other controller tests, but am getting
a nil.rewrite error. Below is what I have...
describe AccountController do
it_should_behave_like ''Application controller''
end
describe ''Application controller'', :shared => true do
it
2008 Jun 03
8
@@state_secret
I was having some issue getting the class variables in
Camping::Session to work with some old apps, so I''ve changed
@@state_secret to a method.
module Blog
include Camping::Session
def state_secret; "kxxxx" end
end
Also, merged some of zimbatm''s patches. And trying to revive the
Junebug wiki <http://github.com/why/junebug> since it''s still
2006 Jun 07
3
Silly question re: scoping of controller actions
Say that there''s a piece of functionality I want to call everytime the
controller is invoked, regardless of what action I am calling. Where do
I put that, exactly?
Can I do that?
--
Posted via http://www.ruby-forum.com/.
2006 Apr 18
3
Capistrano from windows to linux.
There seems to be a bug when deploying a rails application developed
in windows to a linux box. The rake deploy command attempts to run the
command "/install/path/current/script/process/reaper" but the files do
not have the execute bit set.
What can I do to make sure either the execute bit is run or prepend
the command with sh or ruby?
Thanks.
2006 Jan 23
4
Proposal: Deprecate ADO support in the SQL Server adapter
The SQL Server adapter can currently operate in two modes, ADO and
ODBC, each of which uses a different interface to access the db. The
ADO interface is currently the default, while ODBC can be specified as
an option.
I propose this situation is reversed, and that use of the ADO
interface is deprecated, if not removed altogether. Here are some
reasons, I'm sure there are more:
a) ADO uses
2006 Jan 30
14
RoR admin system
I''m preety new at RoR (and programming), I tried a few tutorials, and
really like the RoR simplicity, but my knowledge of the framework still
isn''t very good (to be true, i understand the basics, but not everything
that''s in the tutorials).
But still I''d like to create a website which has:
- front end interface (with no edit functions)
- admin interface
2019 Nov 05
5
No CentOS 8 Updates announced in Centos-announce email list
I learned from the Centos-devel email list that they aren't sending out
email to centos-announce for updates to CentOS 8, but only updating an RSS
feed.
I think this is a bad idea since no one uses RSS anymore (ducks for cover).
What do others here think of this?
--
*Matt Phelps*
*Information Technology Specialist, Systems Administrator*
(Computation Facility, Smithsonian Astrophysical
2007 May 24
3
Help with Create and Update with options_for_select in a select_tag
I have a select_tag in my view that uses options_for_select with
multiple = true. I am having trouble figuring out the Rails way to
create and update that field. Please help.
Models:
-------------
Service has_many AccessControl
AccessControl belongs_to Service
application.rb
-------------------------
$types = Array["Athens", "htpasswd", "IP", "None",
2009 Apr 09
1
undefined method ''text'' ...
Just trying to run the example
*****
require ''rubygems''
require ''mechanize''
a = WWW::Mechanize.new
a.get(''http://rubyforge.org/'') do |page|
# Click the login link
login_page = a.click(page.links.text(/Log In/))
# Submit the login form
my_page = login_page.form_with(:action => ''/account/login.php'')
2010 Apr 26
2
woriking under webrick but not under passenger
Hi!
I have just added login feature to my rails application (followed the
instruction from (Agile Web Development with Rails) but now I am getting
strange errors (looks to me like some kind of routing problem) under the
passenger/apache.
The error is:
500 Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
From the log:
2006 May 10
1
model mixin module madness
If I have several models which exhibit the same functionality, it seems
makes sense to create a mixin, ''include'' it in each model and save
myself some work and repeated code.
Where can I define a module which will be available to all models? I
can''t seem to find a documented place for them.
Alternatively, is there a Rails-standard way of achieving the effect?
Ben
2006 May 19
0
Works in model but not in mixin
Disclaimer: RoR newbie. Using the acts_as_taggable plugin.
As an exercise I wanted to switch from the destructive TAG_WITH method
to adding tags while preserving the existing ones. On the surface this
seemed easy enough and eventually I got it working. However, the
following method:
def add_tags(list)
Tag.transaction do
Tag.parse(list).each do |name|
if
2006 Feb 19
1
NOOB: ratings/voting mixin or code example?
so as to not reinvent the wheel, are there any exisiting examples or
mixins for a star rating system?
basically what i''m looking to do is show pictures of local models which
will be voted on by users, and the model with the most votes will get
her photo in a calendar.
anyone able to point me in the right direction... tutorials, code,
whatever would be greatly appreciated!
-A
--
2006 Feb 22
5
Auditing mixin for model classes. Small problem
I want to include common auditing functionality in my models. This
involves storing the changes made to a model in a seperate table :
I have created the functions in an Audit module :
module Audit
before_update :before_changes
after_update :after_changes
def before_changes
old=self.class.find(id).attributes
@changes=[]
attributes.each do |key, val|
if val != old[key]
2007 Apr 13
0
mixin behavior
Hi, all,
I need to DRY up some code in a few models. My first inclination,
having come from the Java world, was to go with an abstract class.
After a bit of reading, I then decided to follow the mixin route
instead. Now I''m running into trouble, most likely from a few basic
misunderstandings.
There are three models I will be using to average and count rating
data by executing a
2007 May 24
1
How do I show the selected values in options_for_select? Not as simple as it sounds.
How do I show the selected values in options_for_select? I have a
Service model and a AccessControl model. When a user edits a Service I
want the services access_controls to be pre-selected.
Models:
Service has_many AccessControls
AccessControl belongs_to Service
application.rb:
$types = Array["Athens", "htpasswd", "IP", "None", "Other",
2008 May 14
7
A copy of XX has been removed from the module tree but is still active!
I have a class in my /lib/ directory called tracker.rb
It''s function is to receive an array of URLs and then perform 4
separate tasks on each URL
Each of the 4 tasks gets it''s own thread.
the class is called from my controller like:
output = Tracker.go([array_of_urls])
Sometimes, when it hits an exception, instead of just dieing
gracefully, my logs repeatedly display:
A
2003 Aug 04
6
bugs.digium.com
Is anyone else having trouble accessing it with something besides IE on a
Windows box? Opera on Mac/FreeBSD/Linux just hangs at the login page, IE
on Mac and Netscape on Solaris & Linux explode when loading
login_page.php.
2006 Nov 14
11
RESTful mixin, mixin repo?
Hi,
I just put together a little mixin to provide pseudo-RESTful services
in camping apps. Basically, it looks for a hidden _verb field in form
posts, and sets the @method to the supplied value (e.g. put or delete
- which browsers don''t support). This lets you define put and delete
methods in your controllers. Groovy.
Code:
http://pastie.caboo.se/22613
Is there any permanent repo of
2006 Jan 15
6
PROPOSAL: Validations as Mixin
It seems to me that Validations are quite useful for many objects, even
ones having nothing to do with ActiveRecord.
Common examples are Contact Us forms, multi-step forms, web service
paramater validations, etc.
I took a look at the source for Validations, and it seems that it is
very independent from ActiveRecord. I caught only three depenedencies:
1. validates_numericy --> depends on