On Sunday, February 2, 2014 2:41:48 AM UTC, Bizt wrote:
>
> Is this normal? I don't know where it's getting the schema from but it can't
> be reading only from my db:migrate files. Does it get them from log files
> when recreating the db, or does it look directly at the db and rebuild. I
> wan
I've been trying to set default URL parameters in the controller, which
will also be used within the view. This is what I've got:
@params = params
defaults = { :date_from => '21/1/21014', :date_to => '21/2/21014',
:data=>"Expense" }
if @params.any?
@params = defaults.merge(@params)
else
@pa
On Sat, Feb 1, 2014 at 6:30 PM, Bizt wrote:
> In the documentation it seems I can specify which methods I want to allow:
>
> resources :accounts, only: [:index, :new, :create, :edit, :update, :destroy]
> # no show
>
> is this the correct/ best way to restrict access?
You can also use
resource
Hi,
I accidentally created a model with "rails generate model Category" (also
creating migrate file) where I didn't specify any fields. Then I run rake
db:migrate to create the new table. Upon realising what I'd done, I run
"rails destroy model Category". Then I run "rails generate model Catego
Yes, it must be in routes. I forgot. In config/routes.rb it seems to be
handle with:
resources :accounts
In the documentation it seems I can specify which methods I want to allow:
resources :accounts, only: [:index, :new, :create, :edit, :update, :destroy]#
no show
is this the correct/ best w
On Sat, Feb 1, 2014 at 5:18 PM, Bizt wrote:
> I used "rails generate scaffold ..." to build my model, views and
> controllers. However for this particular MVC I don't want to have a show
> template. So, I removed the show method from the controller. But, show still
> appears. Why is this.
What do
I used "rails generate scaffold ..." to build my model, views and
controllers. However for this particular MVC I don't want to have a show
template. So, I removed the show method from the controller. But, show
still appears. Why is this. Does ApplicationController have a show method?
Is the onl
Thank you. Sorry I didn't see -u there before, I see it now. Great
On Saturday, 1 February 2014 18:31:21 UTC+9, Colin Law wrote:
>
> On 1 February 2014 00:06, Bizt > wrote:
> > Thanks for your reply. Can you tell me what "git add -u" does, I can't
> find
> > documentation for that specific opt
>
> Consider, though, that if for whatever reason an invalid id is passed
> in, @account will be nil and so @account.transactions will give you
> a NoMethod error.
>
> What do you want to happen at that point?
>
>
Good point. Thanks, I'll put some checking to see if account is valid or
not a
Just found this site too: http://www.rails-upgrade-checklist.com/
That could be invaluable! Thank you Jesse Wolgamott!
On 2 February 2014 10:51, Timothy Mukaibo wrote:
> The approach you have mentioned sounds incredibly risky, and a debugging /
> support nightmare! Assuming you have good tests
The approach you have mentioned sounds incredibly risky, and a debugging /
support nightmare! Assuming you have good tests in place, I think you're
better off to upgrade from 1 -> 2, 2 -> 3 and then 3 -> 4.
Start by reading the release notes and the upgrade instructions from each
of the major rele
On Feb 1, 2014, at 2:35 PM, Frederick Cheung wrote:
>
>
> On Thursday, January 30, 2014 9:49:41 PM UTC, Ruby-Forum.com User wrote:
>
> [{"id":2, "name":"foo"}, {"id":3, "name":"bar"...
>
> no root elements. Using the active record serializers I've gotten some
> flexibility in specifying th
On Thursday, January 30, 2014 9:49:41 PM UTC, Ruby-Forum.com User wrote:
>
>
> [{"id":2, "name":"foo"}, {"id":3, "name":"bar"...
>
> no root elements. Using the active record serializers I've gotten some
> flexibility in specifying the root element, but now I either end up with
> the above (n
On Fri, Jan 31, 2014 at 9:47 PM, Bizt wrote:
> def index
> @account = current_user.accounts.find_by_id(params[:account])
> @transactions = @account.transactions;
> end
>
> .. works fine
Consider, though, that if for whatever reason an invalid id is passed
in, @account will be nil and so @acc
On Saturday, February 1, 2014 6:33:07 AM UTC, Bizt wrote:
>
> Oh, I think I see. In production ONLY it condenses them all down to a
> single file? Just realized now.
>
That is the default. If my memory is correct it's the config.assets.debug
setting which controls this.
Fred
--
You receive
On 1 February 2014 05:47, Bizt wrote:
> Actually I've changed the whole thing to:
>
> def index
>
> @account = current_user.accounts.find_by_id(params[:account])
> @transactions = @account.transactions;
> end
>
@account = Account.find(params[:account])
should also work. A possible disadvanta
On 1 February 2014 00:06, Bizt wrote:
> Thanks for your reply. Can you tell me what "git add -u" does, I can't find
> documentation for that specific option. Thanks
https://www.kernel.org/pub/software/scm/git/docs/git-add.html
--
You received this message because you are subscribed to the Googl
17 matches
Mail list logo