tall the magic_encoding gem alongside to use it like this:
# $ super_stamper -q && magic_encoding
#
# (c) 2012 Commander Johnson
# Licensed under the MIT license
###
# Is there anyway I can tell the world I'm
.
Thanks!
-- cmdjohnson
On Sat, Jun 9, 2012 at 3:08 AM, Commander Johnson
wrote:
> Hello,
>
> I stumble upon this error when loading a subclass of the Transaction
> class. For full details, see the pastie:
>
> http://pastie.org/4053678
>
> Error message: ActiveRecord::SubclassNo
Hello,
I stumble upon this error when loading a subclass of the Transaction
class. For full details, see the pastie:
http://pastie.org/4053678
Error message: ActiveRecord::SubclassNotFound: The single-table
inheritance mechanism failed to locate the subclass:
'Transactions::DummyDdnlTransaction'
Hello,
I want to present the user with a list of jobs that are scheduled for the
entire year. For instance, for an administrative system, the user can
determine how far ahead an invoice should be sent. The default is 1 month
ahead. So an invoice with date 2012-12-01 will be scheduled to be sent at
Hello,
In HAML, is it possible to get this result:
- link_to "http://www.example.com"; do
- "www"
- "example"
- "com"
=> "wwwexamplecom"
So far I've only managed to get:
=> "com"
Which is logical because of the way Ruby blocks work. But, it defeats the
HAML purpose of concatenating the t
Thanks for your reply (and sorry for this late message, didn't check)
Creating authentication from scratch was a nice exercise, but next time
indeed I'll just use an auth mechanism.
--
http://rubyonrailsdeveloper.nl
--
You received this message because you are subscribed to the Google Groups "
Are you using a static map? If so, maybe I can help you with my static map
setup. I've used the googlestaticmap gem for that.
- unless RAILS_ENV.eql?("test")
- map = GoogleStaticMap.new(:zoom => 11, :center =>
MapLocation.new(:address => resource.full_address), :width => 150, :height
=>
I was using mongrel_cluster in conjunction with Vlad The Impaler some time
ago. Compared to a cloud hosting platform such as Heroku, this is quite
difficult to setup since you'll have to set up SSH keys, think of a port the
mongrel should run on (one that isn't in use!) and when you have multiple
a
1 at 3:55 PM, Rob Biedenharn
wrote:
>
> On Jul 2, 2011, at 5:17 AM, Commander Johnson wrote:
>
> Hey,
>
> I have a gem called 'authorizer' which does authorization for me. It has
> two observer classes that need to be added to the list of ActiveRecord
> observers:
Hey,
I have a gem called 'authorizer' which does authorization for me. It has two
observer classes that need to be added to the list of ActiveRecord
observers:
config/environment.rb:
require "authorizer/user_observer"
require "authorizer/object_observer"
config.active_record.observers = "Author
Hello,
For anyone who might stumble upon the following problem:
In my unit test, I'm checking if the deletion of a Paperclip attachment on
my model actually works. However, when I call Object.save, my file is
deleted from disk! You don't want this to happen in a test environment.
Inspired by some
Hello,
I installed the preferences gem (0.4.2) but it doesn't load the file
app/preference.rb which causes the plugin to fail. I'm on Rails 2.3.11. Any
tips on what I should add to get it working? I'm sure the gem wasn't put on
RubyGems.org just to annoy people that download it ..
The plugin does
Note: I'm on Rails version 2.3.8
Hello,
I'm running integration tests on my controllers with a Watir-controller
Firefox. So two processes are running at the same time:
Process 1: Mongrel server in test environment (script/server -e test)
Process 2: ActionController::IntegrationTest running (also
Hello,
I put the method below in my controller, but I feel it should be in my
Billing::Shared module so it can be used by other controllers as well.
However, this introduces the Can't Dup NilClass message when running a
server in development mode.
Do you have any suggestions how I can DRY this c
Hello,
I have a piece of controller code that needs to be dried up. The part
between the big comment blocks () is the only (!) part of the code that
needs to change for various methods.
I couldn't figure it out because if I would wrap this code in a Proc or
lambda, the render :nothing => true
ot;subject"=>"blabla"},
> {"body" => "blublu", "subject"=>"blublu"} ]
>
> Hope this helps a little!
> Simon
>
> On Sep 14, 5:08 pm, Commander Johnson
> wrote:
>> Hi,
>>
>> When updating a Referral
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:
{"pages_attr
s way the gem is loaded from vendor/gems without looking for system
gems first.
On Sun, Aug 29, 2010 at 8:26 PM, Commander Johnson
wrote:
> Hello,
>
> I'm working with Refinery 0.9.6.25 which has a small bug in a partial
> file. Is there a way to override this file from within my
&g
Hello,
I'm working with Refinery 0.9.6.25 which has a small bug in a partial
file. Is there a way to override this file from within my
application's directory as to fix the bugged line of code?
The file is, from the gem's working dir,
vendor/plugins/refinery/app/views/shared/admin/_resource_picke
Hi,
I'm testing my ActiveMerchant plugin installation with the iDeal payment
method. One test keeps failing even though I've inserted all the
credentials. The other test file, remote_ideal_test.rb, completes 100% of
the tests with the same credentials.
Any thoughts on this error?
Best regards,
C
Hello,
Do you just happen to also be looking for part time freelancers who
want to help you out?
Best regards,
CmdJohnson
On Wed, May 20, 2009 at 8:07 AM, Doris wrote:
>
> Hi All,
>
> I am looking for talented engineers with experince of around 4 - 6
> years having hands on Ruby on Rails, Java
I just found out that I double posted! Please excuse me for that.
On Thu, Apr 30, 2009 at 6:53 PM, Commander Johnson <
commanderjohn...@gmail.com> wrote:
> Anyone else have that if you protect certain actions with Goldberg, you
> can't test them anymore?
>
> I know some of
Did you consider
has_one :wife
And in Wife.rb
belongs_to :man
On Thu, Apr 30, 2009 at 6:49 PM, serenobs wrote:
>
> (my post was deleted i don't know why)
> Hi. I have a question.
> for example, when model records about man, suppose man can marry with
> 1 woman.
> then i think code will be lik
Anyone else have that if you protect certain actions with Goldberg, you
can't test them anymore?
I know some of you are using Goldberg today so how did you manage that? Keep
the controllers as simple as possible? Test them yourself?
Options include:
- Log in a Goldberg user before loading test s
When you protect a controller/action with Goldberg, the functional tests for
that controller will also fail by default.
Has anyone else had this gotcha, and maybe a way to fix it? Logging in the
admin user before starting the test seems the most unobtrusive way ..
--~--~-~--~~
;
>
> On Apr 25, 3:18 pm, Commander Johnson
> wrote:
> > Indeed!
> >
> > named_scope :only_published, :conditions => { :published => true }
> >
> If you're on 2.3 you may also be interested in the default_scope stuff
> that was recently add
Thanks, I just read http://www.ruby-forum.com/topic/133234 which is also
very clear.
I'll just store that Post of the Day inside an ActiveRecord model.
On Tue, Apr 28, 2009 at 8:59 AM, Frederick Cheung <
frederick.che...@gmail.com> wrote:
>
>
>
> On Apr 27, 11:49 pm, Com
Hi Don,
This document helped me to migrate from 2.1 to 2.3:
http://guides.rubyonrails.org/2_3_release_notes.html
I also found a Google search on 'rails 2.3 ' very useful.
CmdJohnson
On Tue, Apr 28, 2009 at 4:51 AM, Don French wrote:
>
> I tried to just change the rails gem I use with my appl
Oh and don't forget rake rails:update!
On Tue, Apr 28, 2009 at 8:54 AM, Commander Johnson <
commanderjohn...@gmail.com> wrote:
> Hi Don,
>
> This document helped me to migrate from 2.1 to 2.3:
>
> http://guides.rubyonrails.org/2_3_release_notes.html
>
> I also fou
Hi Sumon,
I recommend that you start in Windows (because that is your most familiar
environment) using RubyStack:
http://bitnami.org/stack/rubystack
RubyStack is like WAMP for Ruby. When you're comfortable with it, switch to
Linux because it will run much faster.
CmdJohnson
On Tue, Apr 28, 200
class PostOfTheDay
private
def self.current_day
DateTime.now.utc.to_date
end
@@current_post = nil
@@current_day = current_day
def self.get_random_post
posts = Post.all
posts[rand(posts.size)]
end
public
def self.fetch
if @@current_post.nil? || @@current_day !
I for one found this post very useful.
On Mon, Apr 27, 2009 at 10:16 PM, Robert Walker <
rails-mailing-l...@andreas-s.net> wrote:
>
> Amita Bhatkhande wrote:
> > I have read about REST, but never really understood meaning of
> > 'Representational State Transfer'. I tried to read Fielding's
> > di
26, 2009 at 4:52 PM, Commander Johnson <
commanderjohn...@gmail.com> wrote:
> I want to display published posts that are tagged using will_paginate.
> Options include:
>
> 1. Add :conditions => { :published => true } to the find options. Does not
> work because will_pa
I want to display published posts that are tagged using will_paginate.
Options include:
1. Add :conditions => { :published => true } to the find options. Does not
work because will_paginate will then return too many records.
2. Use scope_out in class Post like this:
scope_out :published, :conditi
ons include:
1. Keep a hash 'role model' that is always valid and must be changed with
model validations
2. Convert an existing object to a Hash that can be passed to the 'get'
method.
On Thu, Apr 23, 2009 at 4:27 PM, Commander Johnson <
commanderjohn...@gmail.com> wrote:
Indeed!
named_scope :only_published, :conditions => { :published => true }
On Sat, Apr 25, 2009 at 2:48 PM, Phlip wrote:
>
> Commander Johnson wrote:
>
> > I want the find(:all) method to only return published Comments.
>
> Use a named_scope. It's too easy like
Hi,
I want the find(:all) method to only return published Comments.
This works:
# Override find method to only return published comments
def self.find(*args)
options = args.extract_options!
validate_find_options(options)
set_readonly_option!(options)
case args.first
when :
Hi,
In a Rails functional test, you can say this:
post :create, :post => { :body => 'This is my post.', :title => 'Welcome to
my post' }
This works until you change the Post class' validation properties. Is there
a way to convert an object (that happens to be already valid) to the hash
form requ
The page you mentioned looks very much updated now. A while ago the 'spin'
script was not well documented here.
If you use subversion, don't forget to add the svn:executable property to
the spin script. (Why not do that with all the files in the script
directory?)
On Mon, Mar 16, 2009 at 8:58 AM,
I have tried these IDEs on Windows: - RubyMine
- Aptana Studio
- NetBeans
Also coded a while without any IDE but I need the debug feature.
I recently switched to NetBeans on Ubuntu and it's better than anything
before, especially because Ruby on Linux is much faster. And, both are free
of charg
I found the problem. Goldberg is used to generate the page title, but
generated an error in test mode. A quick fix was to return an empty layout
in test mode.
On Sat, Mar 14, 2009 at 6:20 PM, Frederick Cheung <
frederick.che...@gmail.com> wrote:
>
>
>
> On Mar 14, 2:41 pm,
Yes, like this:
get :reload
puts "@response.body: [...@response.body}]"
Results in:
@response.body: []
On Sat, Mar 14, 2009 at 3:35 PM, Frederick Cheung <
frederick.che...@gmail.com> wrote:
>
>
>
> On Mar 14, 1:29 pm, Commander Johnson
> wrote:
> > @resp
mail.com> wrote:
>
>
>
> On Mar 14, 11:24 am, Commander Johnson
> wrote:
> > Hi,
> >
> > How do you get the rendered output (sent to the browser) in a controller
> > functional test?
>
> Have a look at @response.body
>
> Fred
> >
> &
Hi,
How do you get the rendered output (sent to the browser) in a controller
functional test?
I searched for this, and tried things like
@content_for_layout
@response.template.content_for_layout
yield
yield :layout
CmdJohnson
--~--~-~--~~~---~--~~
You received t
Hi,
I have a model with a callback
(person.rb)
after_create :send_creation_mail
On Windows, this doesn't send until Person.save. On Linux, the hook is
executed upon Person.new.
Any ideas why this happens?
Best regards,
CmdJohnson
--~--~-~--~~~---~--~~
You receiv
Could you please post some code to explainify?
On Sun, Jan 11, 2009 at 3:20 PM, Frederick Cheung <
frederick.che...@gmail.com> wrote:
>
>
> On 11 Jan 2009, at 14:04, Commander Johnson wrote:
>
> > Hi,
> >
> > I've created a simple wizard that collects d
Hi,
I've created a simple wizard that collects data in 3 steps and then posts it
to a Create action.
Validation is only performed when the data is posted. However, I would like
the individual steps to be validated as well. Any ideas on this one?
Example:
Step 1
Name
Email
Email (confirm)
Is t
Hello,
I found that Chang Sau Sheong's ruby-paypal library can use Mass Payment (
http://ruby-paypal.rubyforge.org/) to automatically send money to any PayPal
recipient. What's confusing is that the RDoc on the site is from an older
version that did not support Mass Payment.
Some older (2006) thre
Hi,
Rails doesn't like the model name SampleForm.
I created a scaffold called Tent with the same attributes which does work.
CmdJohnson
On Wed, Oct 29, 2008 at 7:15 PM, Commander Johnson <
[EMAIL PROTECTED]> wrote:
> To no avail:
>
> == 20081023195916 CreateSa
gt; end
>
> def self.up
>create_table :sample_forms do |t|
> t.string :name, :null => false
> t.string :f_title
> t.text :description
>
> t.timestamps
>end
> SampleForm.reset_column_information
> self.add_data
> end
>
&g
Hi,
This is my migration:
class CreateSampleForms < ActiveRecord::Migration
def self.add_data
SampleForm.create(:name => 'Default (Empty)', :f_type => 'Default
(Empty)', :description => 'Use this template to create a blank form.')
end
def self.up
create_table :sample_forms do |t|
Hi,
I've dug into some previous discussion on this list about having multiple
clients running on a single Rails site.
I can see how to work this out with a single project type. For example, my
tenants all have their own CMS in a single Rails environment.
What if 3 of my clients have a CMS site, 5
Hi,
Thanks to Erol for giving me input on how to move stuff to a namespace. It
meant some work, so next time I will spend more time thinking before
blasting off.
I've stored a Form in my DB which has Elements. Below is my FormsController.
All it does is show.
class FormsController < ApplicationCo
Where do I place my layout so I don't have to specify one explicitly?
I got this line of code:
<% form_for([:backend, @form]) do |f| %>
>From here:
http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#M001740
But still get the error
undefined method `form_path' for #
On Sun,
end
admin
elements
forms
layouts
users
My controllers are now layout-less. Should the layouts dir be one higher?
On Sat, Sep 20, 2008 at 5:13 PM, Erol Fornoles <[EMAIL PROTECTED]>wrote:
>
> On Sep 20, 9:57 pm, "Commander Johnson" <[EMAIL PROTECTED]>
> wrote:
When I log in as admin, I get the error:
undefined method `form_path' for #
How do I make the *_path method understand what namespace we're in?
CmdJohnson
On Sat, Sep 20, 2008 at 3:45 PM, Commander Johnson <
[EMAIL PROTECTED]> wrote:
>
> Uh oh.
>
> 500 Intern
Any ideas?
On Sat, Sep 20, 2008 at 2:23 PM, Erol Fornoles <[EMAIL PROTECTED]
> wrote:
>
> On Sep 20, 8:02 pm, "Commander Johnson" <[EMAIL PROTECTED]>
> wrote:
> > Hi,
> > I've built the Admin section of my project first, and would like to move it
Your first post looks like it's exactly what I need.
Moving from Default namespace to Admin namespace is what I wanted.
But if there is a faster way, please don't hesitate to share.
On Sat, Sep 20, 2008 at 2:34 PM, Erol Fornoles <[EMAIL PROTECTED]>wrote:
>
> I think I got it all wrong. You want a
Hi,
I've built the Admin section of my project first, and would like to move it
to its own Admin namespace.
I have four resources: Form, Element, Admin and User.
Old URL would be:
localhost:3000/forms
New URL would be:
localhost:3000/admin/forms
How do I migrate from one namespace to another?
You can learn rails with v2, but some things like migration file names and
especially dynamic scaffolding will be different. If you don't want to remap
everything in your brain, get the 3rd edition eBook.
On Thu, Sep 18, 2008 at 8:44 PM, Guillermo Acilu <[EMAIL PROTECTED]>wrote:
>
> Hello guys,
>
r and
ElementsController.
On Sat, Sep 20, 2008 at 12:49 PM, Erol Fornoles <[EMAIL PROTECTED]>wrote:
>
> On Sep 20, 5:09 pm, "Commander Johnson" <[EMAIL PROTECTED]>
> wrote:
> > Hi,
> > When users are logged in, they should always have a 'Logout' f
Hi,
When users are logged in, they should always have a 'Logout' function handy
somewhere.
Users control Forms and Elements using two controllers, FormsController and
ElementsController.
What at least works is to add the following lines to the end of both layout
files.
views/layouts/elements.erb
Hi,
According to Agile Web Dev with Rails v3, you shouldn't use an IDE at all.
Why do you even ask? :)
Contrastly, I've been a NetBeans user for a time so I downloaded the Ruby
package, and I still use it. I recently switched to 6.5 beta because of
Rails 2.1.1 support and a smaller footprint.
I d
Thanks, that worked.
What's the difference between hidden_field and hidden_field_tag?
On Thu, Sep 18, 2008 at 10:18 PM, Ar Chron <[EMAIL PROTECTED]
> wrote:
>
> You can store the form_id in a hidden field (hidden_field_tag).
>
> That value will come back in the params hash, to be retrieved and
>
Hi,
I'm using Gmail to follow the list.
Way below in the conversation, I see this message:
11 deleted messages in this conversation.
Any ideas why this is? Gmail does a good job in showing only the relevant
messages, but deleting seems a bit rough?
CmdJohnson
--~--~-~--~~-
object.errors looks like a hash. Can you do a puts object.errors and post
the result?
If it says :email => 'foo' somewhere, you should be able to do
object.errors.clear :email
On Fri, Sep 19, 2008 at 1:54 PM, Tom Styles <
[EMAIL PROTECTED]> wrote:
>
> Tom, did you ever get a solution to this pro
Hi,
You are welcome to comment on every aspect of this post -- not just the core
question at the bottom.
My application renders forms previously stored in the database. A Form
consists of Elements:
t.references :form,
:comment => 'What form we belong to.'
t.decimal :ordering,
This book starts from scratch. It teaches you those basic principles in
Ruby.
http://pragprog.com/titles/fr_ltp/learn-to-program
I didn't learn to program from this book, but I thoroughly enjoyed reading
it.
On Thu, Sep 18, 2008 at 3:04 PM, cherrian harada <[EMAIL PROTECTED]> wrote:
> I have 0%
I found the members of this group to be very helpful indeed!
I like this book:
Agile Web Development with Rails, Third Edition
http://pragprog.com/titles/rails3/agile-web-development-with-rails-third-edition
It takes you step-by-step in creating your own Pragmatic Bookshelf
application, explaini
If it helps, NetBeans 6.5 Beta uses a newer version of JRuby with a
smaller footprint.
On my machine, 6.1 JRuby would simply run out of memory trying to
perform a Gem Update.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google G
Hi,
I'm creating a simple Migration that adds test data to my database.
A Form has many Elements and every Element belongs to a Form. An element has
the mandatory columns name, type and value.
---
class AddTestData < ActiveRecord::Migration
def self.up
Form.delete_all
Element.delete_al
71 matches
Mail list logo