I wrote a Gem (https://github.com/absolutedevops/civo) which is a simple Rails
Engine containing a few API accessing models.
However, when I include it in a Rails project, any generators create their
files under the Gem's source code not the project's. I can't see anything I'm
doing in the Gem
ons" where
requests have to come back to the same backend server.
Hope this helps.
Cheers,
Andy
*Andy Jeffries* Ruby on Rails, RubyMotion, jQuery Developer & Taekwondo 6th
Dan Instructor
andyjeffries.co.uk +44 7939 164853 @andyjeffries
<http://twitter.com/andyjeffries>
Yes, Engines are considered part of the framework level rather than the
application level. If I developed an engine and released it as a gem, you
wouldn't want my lines littering your application stack trace, right?
Cheers,
Andy
*Andy Jeffries* Ruby on Rails, RubyMotion, jQuery Deve
ces one has to be careful that one is seeing a real
> effect, which apparently you were, so that is all right.
>
Doh, fair point, thanks for catching that :-)
Cheers,
Andy
*Andy Jeffries* Ruby on Rails, RubyMotion, jQuery Developer & Taekwondo 6th
Dan Instructor
andyjeffries.co.uk
On 17 March 2014 15:32, Colin Law wrote:
> Did you try swapping the two lines round and checking that the result
> is consistent?
>
Yes, it's consistent for me. Was it not for you or are you just asking?
Cheers,
Andy
--
You received this message because you are subscribed to the Google Gro
According to a quick benchmark on my machine (MacBook Air 2013, Ruby
2.1.0p0), using double quotes is about 2% faster:
require 'benchmark'
n = 10_000_000
Benchmark.bm do |x|
x.report { n.times do ; a = "1"; end }
x.report { n.times do ; a = '1'; end }
end
user
The company I'm currently contracting at has released their first piece of
Open Source Software, a Ruby gem for interacting with REST servers. There
are other gems out there but we wanted something that felt more like using
ActiveRecord (like ActiveResource) but more customisable.
http://whichdig
I've also just tried upgrading JSON to 1.6.0 (as that's the version that seems
to be installed if I do gem install json), same problem.
Cheers,
Andy
--
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
> I was basing it on this article (as well as a stack overflow answer) that you
> can provide a custom serializer in Rails 3.1:
>
> http://edgerails.info/articles/what-s-new-in-edge-rails/2011/03/09/custom-activerecord-attribute-serialization/index.html
>
> JSON provides a dump and load method
> the second argument to serialise is used to say that you always want
> the serialised object to be of a certain class (e.g. Hash, an
> application specific class etc.). I'm not sure what you meant by
> passing JSON as that argument but I suspect that it isn't doing what
> you think it is.
I was b
When I create a table with the following SQL:
# create table foos (id SERIAL, content VARCHAR(255));
And define a class as follows:
class Foo < ActiveRecord::Base
serialize :content, JSON
end
Creating a new instance of the class gives an error:
> f = Foo.new
NoMethodError: undefined method `
It's a generator, but it comes up with quite nice 37 Signals style admin
interfaces.
http://github.com/andyjeffries/andy_admin
Cheers,
Andy
--
Andy Jeffries
http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery
Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS
Company n
Hoptoad
--
Andy Jeffries
http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery
Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS
Company number: 5452840
On 28 July 2010 11:26, Pale Horse wrote:
> Ideally, what I need is a method of rescuing ALL errors that can occur
>
Sorry, no idea.
(just to let you know that you're not being ignored it's just likely that
no-one has an answer for you, this generally works fine for me).
--
Andy Jeffries
http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery
Registered address: 64 Sish Lane, Stevenage, Hert
On 23 July 2010 10:52, Tom Mac wrote:
> I have a of line code like
> <%= stylesheet_link_tag "styles",:cache => "cache/styles" %>
>
>And it produces source as
>
> rel="stylesheet" type="text/css" />
>
>config.action_controller.perform_caching = true
>
> My concern is what is 1279620123 a
I wouldn't normally post silly little corrections/typos, but as the OP was a
newbie (and might play with it, type the code in and fail to get it all to
work):
> $ ./script generate scaffold User login:string password:string
> first_name:string last_name:string
>
Should be:
$ ./script/generate s
>
> Why is mySQL not the typical default DB?
>
Because SQLite is easier to install/maintain on a developer's machine. It's
easy enough to switch to MySQL when creating a project:
rails my_project -d mysql
> I'm used to building up tables by hand...I'm aware there is a faster way
> of doing it
>
> The rails output shows:
> [paperclip] An error was received while processing:
> # pDBak1ufEeSHluZ8kAougU+++TI/-Tmp-/stream20100721-4816-1pbpnnn-0 is not
> recognized by the 'identify' command.>
>
> What is the best way to do this?
>
The normal cause of that problem in my experience (and I've h
On 19 July 2010 16:38, Abder-Rahman Ali wrote:
> I now added /usr/local/bin to my path as follows:
>
> export PATH=$PATH:/usr/local/bin
>
> http://www.how-to-linux.com/2010/04/how-to-add-usrlocalbin-to-your-path-on-centos/
Good job.
> But, when I run now: brew install git
>
> I get the follow
>
> Anyway, unless you are using your Mac as a server, why are you running
> Passenger on it in the first place? Mongrel is perfectly suitable for
> development.
>
A lot of people:
1) Work on more than one site at a time (during a day)
2) Want it always available rather than having to remember
On 19 July 2010 15:46, Abder-Rahman Ali wrote:
> I know that this question may not be here, but think that most of you
> using RoR deal with Git.
>
> I run a MAC OS X 10.5.8, and want to install Git running on my machine.
> But, I didn't find this version of my MAC OS X here: Hi,
>
> http://code.
>
> It mentions that we have the following in the "routes.rb" file:
>
> map.connect ':controller/:action/:id'
> map.connect ':controller/:action/:id.:format'
>
> Now, in completing the tutorial, we will add the following to
> "routes.rb":
>
> map.root :controller => "home"
>
> In the first two stat
>
> > http://github.com/andyjeffries/andy_admin
>
> Thanks a lot.
>
> Does it give you the layouts to the pages?
>
It generates the stylesheets and layouts, styles a lot of the standard
classes and gives an amended form builder.
> Do you have an example of that?
>
I've been meaning to put toget
Or as another example:
http://github.com/andyjeffries/andy_admin
:-)
--
Andy Jeffries
http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery
Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS
Company number: 5452840
On 18 July 2010 08:25, Abder-Rahman Ali wrote:
> I th
>
> > Welcome to dynamic objects and classes :-)
> Thanks. This restores my faith in Rails and enhances my appreciation
> of newsgroups, especially this one.
> Now I've got to put them to use!
>
Good luck.
Post back if you have any more problems.
Cheers,
Andy
--
You received this message b
>
> > what makes you think they aren't there ?
>
> I searched for them to no avail. Shouldn't they be in the
> Expense model (app\models\expense.rb); or
> Expense controller (app\controllers\expenses_controller.rb?
>
No, they are dynamically defined and exist in memory only at runtime.
Welcome t
>
> My thinking is that perhaps every time a page is rendered, a mongrel has
> to instantiate this controller and that marshalling this into RAM is
> very time-consuming. Or does a controller get loaded into RAM at server
> startup and then the effect is not all that substantial for each page?
> A
On 16 July 2010 13:51, Michael Pavling wrote:
> On 16 July 2010 13:48, Ram wrote:
> > Anyone know a function that loops through an array and returns true if
> > any one element satisfies the condition but false if none satisfy the
> > condition? And it should do this in one line. Something like
>
> What the purpose to hide the controller and action from URL?
>
To have nicer URLs? For example:
http://www.facebook.com/andyjeffriesrather than
http://www.facebook.com/user/show/andyjeffries
It's quite a common request.
You can use the Apache mod_rewrite itself to make this change. You will
>
> Thanks for the suggestion. However what did you mean specifically with
> your last comment?
>
> >> With anything like this any time you save when building up the
> conditions
> >> will be dwarfed by the time it takes to run the actual query
>
Putting words in Frederick's mouth, but it simply m
seem to be multiple posting the same question, phrased
slightly differently without reading responses.
Cheers,
Andy
--
Andy Jeffries
http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery
Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS
Company number: 5452840
On 16 July 2010 11:53,
>
> I am new in ROR.
>
> I want to hide controller and action name from url.
>
> exp. my current url:
>
> http://localhost:3000/triggers/index/amit123
>
> expected:
>
> http://localhost:3000/amit123
>
> remove controller(trigger) and action(index) name from url.
>
http://guides.rubyonrails.o
>
> I am a rails beginners. I have created a couple of simple applications
> without following TDD.
>
> I have a question - Do good programmers really follow TDD strictly ? I
> mean.. Do they follow { 1. Write Test 2. Write Code 3. Refactor }
> cycle ?
>
> Is Writing tests before Implentation co
Good catch Hassan
--
Andy Jeffries
http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery
Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS
Company number: 5452840
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" grou
>
> this his the generated code from my haml code
>
>
> Anglais option>
> Français
> Allemand
>
>
> but I get a JS error
>
> this.form is undefined
>
> what did I missed ...
>
The onchange event is on the tag, so "this" is a form and doesn't
have a ".form" method. Try doing:
http://groups.goo
>
> Please don't make it a flame war about linux distros.
> To the OP, I really haven't heard about any Gentoo user in the rails
> community so far, if I have to say there's a predminant OS in the
> rails community that would be Mac OS. (And I don't know why either)
>
As a Mac OS X user I don't pa
ere may be a better way with Restful_authentication and you'll need to
find out the param names you need to change the values for, but that may
point you in a direction to get it working...
Cheers,
Andy
--
Andy Jeffries
http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery
Registe
On 8 July 2010 19:39, Erwin wrote:
> In a test app, I have a drop-down selection to change the language of
> the site.
> I use an Ajax request to an action in which the locale is changed, and
> the it's redirected to the home page
> unfortunately, the locale seems to be changed but the home page
On 9 July 2010 00:32, Gerardo Gonzalez Cruz wrote:
> I Work rails on my beauty Gentoo System, i find hard install rails over
> Ubuntu because you need know each package to install :-(, on Gentoo is easy.
Really?
apt-get install ruby1.8 ruby1.8-dev rubygems
gem update --system
gem install rails
$ irb
> class MyHash < Hash ; end
=> nil
> h = MyHash.new
=> {}
> h.is_a? Hash
=> true
Cheers,
Andy
--
Andy Jeffries
http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery
Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS
Company number: 5452840
I'd recommend starting here...
Episode 141: PayPal Basics<http://railscasts.com/episodes/141-paypal-basics>
Cheers,
Andy
--
Andy Jeffries
http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery
Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS
Company number: 545
On 7 July 2010 01:25, Skip Levens wrote:
> Props to Andy's solution - thats pretty awesome... hopefully not
> everyone needs that!
>
Thanks Skip and I agree with your hope.
There are so many weird things I've done on this project, it's been a
great/interesting experience...
Cheers,
Andy
--
>
> Interesting solution, but also not secure. Anybody who has root can
> read out your running processes' memory spaces and either (a) grab the
> key and yer pwned or (b) grab the bytecodes, decompile and yer pwned.
>
Yep. Completely agree. They weren't planning on stopping crackers, but
sysadm
>
> >> Or if there is any way so that I can encrypt my code
> >> without interrupting the execution of the application.
>
> If your client is determined to access your code even an encryption of
> the Ruby source code will not be sufficient. In order for MRI to
> interpret Ruby it must be decrypted
>
> > We're developing the site but the day to day running is down the client
> (but
> > they have lots of power from various sources, redundancy and sysadmins to
> > type the password back in).
>
> Is the client trying to keep the code hidden from his own sysadmins or
> are you trying to hide it f
On 6 July 2010 11:31, Michael Pavling wrote:
> On 6 July 2010 11:19, Andy Jeffries wrote:
> > You can do this (I've had to do it for a client) but it's not simple
> >
>
> Very interesting approach. Will file that for future reference.
>
I hope you never n
On 6 July 2010 10:34, Sumanta Das wrote:
> Or if there is any way so that I can encrypt my code
> without interrupting the execution of the application.
You can do this (I've had to do it for a client) but it's not simple and I
can't share my solution's code. However, you basically go along th
On 29 June 2010 11:00, Neil Bye wrote:
> I have this bit of code in my email.controller
>
> user = @current_user
> story = @current_story
> recipient = story.user
>
> It doesn't work because @current_story isn't defined. How can I find the
> current page to make this work?
You haven't given any
We're actually looking for currently UK located developers.
Thanks anyway,
Andy
--
Andy Jeffries
http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery
Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS
Company number: 5452840
On 26 June 2010 08:21, ratnamraj varasala
The company I'm contracting at is looking for:
An enthusiastic, junior Ruby on Rails developer. Maybe you've been using
PHP for a few years and have recently started playing with Rails or you've
been using Rails for a while but only in a small/sideline capacity and want
to move up to using it in
>
> > Use Apache locally too. It's simple, Apache is already installed on
> > Snow
> > Leopard. Install Passenger and configure it (which you'll need to learn
> > how
> > to do for production anyway).
>
> What a waste of effort IMHO. I've never used anything but Mongrel
> locally. It works fine
Look in your log file (your_app/log/*.log) - the error will be detailed in
there.
Also, it seems from the error message you're running in production mode, you
should really switch to development then you'd see the full error message in
your browser.
Cheers,
Andy
--
Andy Jef
>
> If you have two floating point values representing seconds (and parts of)
>> why can't you just compare the two floating point values?
>>
>> What part are you stuck with? Can you give us some code with a comment on
>> which bit you can't do.
>>
>
>> I don't have a problem with comparing floats
>
> These values are then converted to seconds and stored as decimal in the DB
> (I allow fractions of a second, too (tenth, hundredth, millisecond). when
> they are retrieved form the DB, I convert the seconds to a string format of,
> for example, 01:39:11 (from 5951 seconds). If fractions are use
>
> I have been just tasked to learn Rails for a new project and have been
> given Mac machine for it. I have never used a Mac / Linux ever. I have
> used Rails before on Windows. I need to set up Rails development env
> on this Mac machine. Its Mac OS X - Snow Leopard. The development
> environmen
rake db:seed RAILS_ENV=test
--
Andy Jeffries
http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery
Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS
Company number: 5452840
On 4 June 2010 15:31, Ramos wrote:
> I am seeding my environment for testing, but I am doing it upon
>
> See the :cache => true option of stylesheet_link_tag
> http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#M002231
You don't have to use true either - you can use a string (so if you have
more than one layout each using a different set of stylesheets you can
create indiv
stylesheet_link_tag with the :cache option.
Cheers,
Andy
--
Andy Jeffries
http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery
Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS
Company number: 5452840
On 4 June 2010 09:37, Gregory Ma wrote:
> Hi,
> I work on a w
>
> Out of interest, what's your problem with the above code?
>>
>> its crutch, for incomprehensible thing
>>
>
> Sorry, I don't understand - could you rephrase...
>
> U should not insert if request.xhr?
> u can create view, with build js ( show.js.erb)
> and in its view call render, but with js
>
> Out of interest, what's your problem with the above code?
>
> its crutch, for incomprehensible thing
>
Sorry, I don't understand - could you rephrase...
> Premature optimisation is the root of all evil...
>
> yep, but i'm thinking, that write 1-10 LOC in js, witch will be build
> partial for
>
> > class UserAccount < ActiveRecord::Base
> > serialize :meta_data, Hash
> > end
>
> That would get it working to demo, but I *know* that they're going to
> want to search/filter on the attributes once they have their hands on
> them, so I'd prefer to start with a DB record per attribute that
On 3 June 2010 15:17, Ivan Nastyukhin wrote:
>if request.xhr?
> render :partial => "whatever"
> end
>
> if developers, from my team, write this, i curse too much for such)
>
If a developer from my team makes a judgement/technical direction based on
incomplete facts I'd curse too much
On 3 June 2010 15:06, Michael Pavling wrote:
> I've a requirement to put some user-managed attributes on a model.
>
> Essentially, I want Entity-Attribute-Value functionality - the
> administrator has the ability to create "fields" on the model, and to
> specify their type (datetime, string, bool
>
> mm, u can do it
> but
> 1) u should write yet anothe action at controller, its not like REST
>
No reason why you should...
def show
...blah...blah...blah
if request.xhr?
render :partial => "whatever"
end
end
> 2) its will be more slower, than render at mobile device, from json
>
> This is exactly what I planned to do until you said it would be better
> to return json
>
Ivan said it would be better, not me :-)
I said that it is faster/lighter weight - but not better and said I
disagreed with him.
Cheers,
Andy
--
You received this message because you are subscribed
>
> I'd do it as the OP requested, have a partial used in both places and
> return that.
>
Sorry, just realised you were the OP :-)
In particular I'd use jQuery's load method to load the URL in to an element
(the original page's container for this section):
http://api.jquery.com/load/
And from
>
> > It's faster/lighter to do it that way.
> >
> > However, you often break DRY* as you have two sets of logic used to
> > create
> > markup from a dataset (one in Rails and one is JS). So I'm not sure I
> > agree
> > with Ivan.
>
> If you don't agree how would you do it?
>
I'd do it as the OP
>
> > yep u can
> >
> > index.js.erb
> >
> > and in it, render your response
> >
> > buts its worse idea, return json, and build dom
>
> I'm not sure to understand.
> You think it's better to return json and than build the dom from the
> javascript?
>
It's faster/lighter to do it that way.
Howeve
http://tinyurl.com/253tgp8
(hint to Ivan, use http://lmgtfy.com/ - it's great for links like this :-) )
--
Andy Jeffries
http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery
Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS
Company number: 5452840
On 3 June 2010 14:00,
>
> > and if you ask a boss or customer what is that
> > they prefer, pretty vs. working code, I can tell you that not 100 but
> > 200% of them will choose working. ;)
>
> I don't give my clients that choice. They get properly designed code
> that works. It's not up to the client to make technica
>
> http://weblog.rubyonrails.org/2006/3/1/new-in-rails-enumerable-group_by-and-array-in_groups_of
>
> enjoy!
>
This isn't quite the same thing though.
>> a = %w(1 2 3 4 5 6 7 8 9 10)
>> a.in_groups_of(3)
=> [["1", "2", "3"], ["4", "5", "6"], ["7", "8", "9"], ["10", nil, nil]]
It gives you 4 gr
> Â ActiveSupport::JSON.decode(cookies['item_list'])
>
> and the result is actually in a hash, then the ordering is lost...
>
> Is it true that if the original JSON object has an array of hashes (1
> key and 1 value), then the order can be preserved?
>
> But what if the original JSON object was a ha
On 27 May 2010 15:45, james wrote:
> I need to make some minor record changes in the database on my live
> production site. I use Capistrano to deploy. I know I can activate
> script/console by entering my "/current" Capistrano directory and
> running:
>
> RAILS_ENV=production script/console
>
> A
On 27 May 2010 15:15, anon_comp wrote:
> I know this has already been resloved, but instead of creating a new
> migration, you could have gone back to version 0
>
> rake db:migrate VERSION=0
>
> then run rake db:migrate
>
> this should update all migrations you edited.
The downside is that migrat
>>> I edited migrations on my local machine and checked in them.. :) Just
>>> now i realised that this could be the problem of me.
>>
>> It is indeed :-)
>
> Resolved it. Thanks to all of you with a big smile .. :) :)
Happy to help.
Good luck,
Cheers,
Andy
--
You received this message becaus
>> Did you create new migrations or edit existing ones?
>
> I edited migrations on my local machine and checked in them.. :) Just
> now i realised that this could be the problem of me.
It is indeed :-)
> Ok tell me one thing, if i edit a already migration file, and run rake
> db:migrate then woul
> I am in a great need of you people. My migrations are not running on
> production database. I done some changes in production mode and then i
> ran rake db:migrate RAILS_ENV=production / RAILS_ENV="production". But
> my database is not reflecting. Can you people tell me that what are the
> possib
>
> What would happened if you never use private methods? Will it be some
> security issue (and if yes, I'd like to see an example if it is
> possible)
OK, here's a quick example. Assuming you have the default routing rules in
place so it handles /:controller/:action
class LoginsController < Ap
>
>@licences = Licence.scoped_by_user_id(10)
>usedpermlicence = @licences.scoped_by_status_and_licence_type(1, 0)
>usedtemplicence = @licences.scoped_by_status_and_licence_type(1, 1)
>remainlicence = @licences.scoped_by_status_and_licence_type(0, 0)
>remaintemplicence = @licence
le to quickly
insert a million rows, then actually test/benchmark your app.
Cheers,
Andy
--
Andy Jeffries
http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery
Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS
Company number: 5452840
On 29 April 2010 09:13, TechSlam wrote
>
> in my application, i have login form. while login into the application
> iam maintaning the details in session. i want to remove the stale
> sessions and while removing the stale sessions i want to perform some
> operattions on database . how to do this.
>
How are the sessions stored? The def
>
> > Mohammed, you can write the above as follows:
> > @property.destroy if IsAuthorized?(@property.user_id)
>
> Well, you could, *if* IsAuthorized? -- which idiomatically should
> be is_authorized? -- returned a boolean value :-)
>
Personally I'd prefer authorized? - I never use is_...?, the is_
Yes. Yesterday called, they want their news back...
http://twitter.com/#search?q=rubyonrails.org
--
Andy Jeffries
http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery
Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS
Company number: 5452840
On 21 April 2010 10:09, Amala
>
> > Having a bit of a braindead day, can anyone help with this. I have three
> > models: Player, Game, Prediction (Player has_many :games, :through =>
> > :prediction)
> > I want a named_scope that finds games that the current player hasn't
> already
> > predicted.
>
> How about tackling it from
thing I've done over and over again, but I just
can't get it clear in my head today.
Any ideas?
Cheers,
Andy
--
Andy Jeffries
http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery
Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS
Company number: 5452840
--
You re
There's normally an actual error above that, you've posted the stack trace
(which is useful after you know what the error is).
Cheers,
Andy
--
Andy Jeffries
http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery
Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS
Comp
>
> Thanks for your views. I wonder why this is not taking up. I know
> drupal is stealth.
> But with handy rails in hand, if we start now, in a year we could make not
> only drupal,
> a double or triple that of a drupal. Because I believe that drupal with
> PHP, not that
> easy to make upgra
>
> > http://www.example.com/products/category/5
> >
> > Then it would work - the 5 would become 5.html in a folder called
> > category
> > in a folder called products.
>
> Thank you Andy for you explanation.
> How do you do to make your urls look like this?
>
config/routes.rb
map.category "/prod
>
> I've been reading the Rails Guide about caching and I have a few
> questions about it.
> I've read that it is not possible to cache a page with url parameters,
> for instance 'http://.../com/products/category_id=5'. Am I correct?
> Isn't there any way to be able to do so?
>
You can do it, but
On 19 April 2010 10:25, Amala Singh wrote:
> If it takes one year to develop a CMS in rails then is that rubbish that
> have tutorials
> that claim develop a blog in 15 minutes?
It would take less than a year to develop a CMS for a client (I've done it a
NUMBER of times), but to develop a CMS f
Along with Bundler which now puts all gems directly in to your project
(there is a blog post somewhere on using Bundler with Rails 2.3...)
Cheers,
Andy
--
Andy Jeffries
http://andyjeffries.co.uk/ #rubyonrails #mysql #jquery
Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS
>
> > Yes, I know about this AR behavior.
> > I think, would be correct if the comparison works both ways.
> > For beginners, it looks like a bug.
>
> Is it really worth monkeypatching Array#eql? for this? I think not.
>
I almost posted the same thing earlier, but had a second thought.
Would it
>
> I have searched for a development sandbox tool, like virtualenv or
> buildout in python. But I didn't have results.
> Please, Any suggestion?
>
What do you mean?
Running 'rails sitename' will create you a website.
>From the resulting sitename folder you can do script/console to run an
intera
>
> i am very very interested on Ruby on Rails
> technology presently i am working as SEO and Web analytic and now i
> want to learn all about Ruby on Rails so please help me for it
>
I'd recommend this site :
http://tinyurl.com/cvh574
Good luck,
Andy
--
You received this me
>
> if i went with the intermediate form option, how would i pass my
> variables from the first form to the second? Thanks
>
Something like this:
class ProductController
def new
@product = Product.new
end
def confirm
@product = Product.new(params[:product])
end
def create
On 14 April 2010 15:18, Chris Habgood wrote:
> ok as far as controllers are concerned in a RoR app would either of those
> style matter as far as name spacing?
>
Nope, won't matter a jot.
But if you have this:
class Admin::FooController
end
without declaring Admin first you'll get an error.
>
> You've uncovered Active Record's terrible secret, files isn't actually
> an Array.
>
Actually I'd call it magic or voodoo, but not a dirty secret.
It's actually a brilliant/necessary part of the arel features in Rails 3.
When you select a recordset using Rails 3 arel features (where, order,
>
> I did this A Lot.
>
> :order => "#{params[:order_by]} = 1"
>
This should probably be something more like:
session[:order_direction] ||= "ASC"
:order => "#{params[:order_by]} #{session[:order_direction]}"
there is a Write Query Running in my logger But Nothing happens .i thinks
> there must
On 14 April 2010 02:57, David Zhu wrote:
> Before a user submits a form can I redirect them to a confirmation
> page with all their fields on it, and then finally, there is a final
> submit button that saves it to the database? Tanks
You could code this, yes.
You'd want to put a copy of the pa
On 14 April 2010 12:29, ashu wrote:
> What i have
>
> What i need
> when user Click On Age or name or sex records
> should be in that order as user clicked.if user clicked on age Twice
> Then record should reverse . that would be bonus .
> By default it Should Be As work
1 - 100 of 199 matches
Mail list logo