Displaying 20 results from an estimated 9000 matches similar to: "Accessing model objects directly in the view"
2007 May 22
5
rails edge
hi,
first time trying rspec, and rails edge. Are there any known issues
running rspec with rails edge?
for one, apparently script/generate scaffold_resource has been
renamed just "resource". Do I just search/replace "scaffold_resource"
with "resource" in file rspec_resource_generator.rb ? Somethings
still missing.
before i get "Couldn''t find
2006 Nov 03
10
[PLUGIN] rspec_resource_generator - RESTful scaffold generator with RSpec specifications
rspec_resource_generator
========================
By Pat Maddox
Use this generator to generate RESTful scaffolding with RSpec specifications.
Syntax is exactly the same as the scaffold_resource generator:
./script/generate rspec_resource ModelName [field:type field:type]
When you run this generator, it will create a migration, model, and
model spec file. In addition, it gives you a RESTful
2009 Sep 05
2
Anova over a list of models
I have a list object, in which I have stored n lme4-models. For example:
library(lme4);
myModels <- list();
myModels[1] <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
myModels[2] <- lmer(Reaction ~ Days + (1|Subject) + (0+Days|Subject),
sleepstudy)
Now I would like to perform an anova over all models in the list. However,
the anova function requires that every model is inserted
2006 Feb 01
4
exclude a column in save!
Hi all,
I have a column that peeks its value from a sequence (postgres) some
times. Other times, I set it to a certain value.
This column has a default value of "nextval(''the_sequence'')"... When I
want that this column peeks the value from the sequence, I do this:
obj = Mymodel.new
obj.some_column1 = blah
obj.some_column2 = blah
obj.some_column3 = blah
obj.save!
but
2007 Sep 22
2
Dynamic view - is it possible at all?
I have the following question. It sounds weird, but still.
We all have app/views/say.rhtml or any other template for the view. It
can include of course instructions in <% %>
So the question is next -- is it possible to use .rhtml as a view
which we just uploaded?
I.e. user uploads his own .rhtml, controller saves it in the database,
and shows the view using it.
Is it possible at all?
2007 Feb 01
12
RESTful Rails and other musings
Hi all,
I would first like to introduce myself to the Ruby on Rails (RoR)
community and to say that I hope to begin to build some relationships
with other RoR developers.
I''m a long time Java programmer (5+ years). Java was my first
experience with Object Oriented Programming (OOP). Before Java I
developed using many other languages including C, Pascal, Fortran,
BASIC, Visual Basic,
2012 Sep 08
4
dash symbol
In the example below, what is the dash doing between the class
attribute and array:
(field_helpers -
[:label, :check_box, :radio_button, :fields_for, :hidden_field, :file_field]).each
do |selector|
--
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
2010 Feb 10
7
undefined method join
Hey all,
I get an undefined method `join'' for #<String NoMethodError.
student.rb
has_one :student_fail
attr_accessor :student_fail_attribute
#controller
def student_fail
@student = @student.find params[:id]
def update_student_fail
@student.build_student_fail params[:student][:student_fail_attribute]
if @student.save
#view
form_for @student do |f|
2006 Jul 20
3
AOP in Prototype / JS
Hey folks
I am just investigating using Aspects for logging my main Javascript
"interfaces". I don''t believe Prototype has any built in capabilities
for this but I just thought I''d check and see how people had tackled
this before.
I am still getting to grips with core JS so apologies if this is easy
or obvious..
I am Googling as we speak also..
Cheers
Matt
2006 May 19
11
Prototype / Scriptaculous & Dojo
Are these libs compatible
? At the very least I''d like to be able to use Prototype & Dojo ?
Thoughts welcome..
Matt
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
2008 Jul 25
21
Problems with mock assigned to a constant
Hi all,
Initially I thought this was a bug in the built-in mocking framework(and it
still may be), but I better hash it out on the mailing list before I
file/reopen the ticket:
http://rspec.lighthouseapp.com/projects/5645/tickets/478-mocks-on-constants#ticket-478-6
I thought my example illustrated my problem, but obviously I was passing the
wrong arguments to the mock. I revised my example to
2006 Oct 06
1
8th method for scaffold_resource
I was reading a blog where at RailsEurope David spoke about adding a
"search" method into the scaffold_resource. Anyway I haven''t seen
anything else on it and wanted to know if there is any more information
someone here could share.
Stuart
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
2006 Nov 18
1
ActiveResource sample code?
I''d like to play around a bit with ActiveResource for consuming a web
service. Does anyone have sample code they would be willing to share?
I''ve googled all around and have come up empty except for simple (non-
working) examples given in the RailsConf keynote and some associated
blog entries.
Thanks!
cr
--~--~---------~--~----~------------~-------~--~----~
You received
2013 May 21
1
Calculating AIC for the whole model in VAR
Hello!
I am using package "VAR".
I've fitted my model:
mymodel<-VAR(mydata,myp,type="const")
I can extract the Log Liklihood for THE WHOLE MODEL:
logLik(mymodel)
How could I calculate (other than manually) the corresponding Akaike
Information Criterion (AIC)?
I tried AIC - but it does not take mymodel:
AIC(mymodel)
# numeric(0)
Thank you!
--
Dimitri Liakhovitski
2012 Jan 01
4
Chronic parsing date range in console but not in application in rails 3
Hey all,
Chronic will parse a date range in console:
Chronic.parse(1/1/2011 - 1/1/2012, :guess => false)
=> 2012-01-01 12:00:00 -0500..2012-01-01 12:00:01 -0500
However, when I use logger to check if it''s parsing in application, it
is not:
logger.info "The value of history date is #{history_date}" =>
The value of history date is 1/1/2011 - 1/1/2012
2011 Aug 24
2
Regression by factor using "sapply"
Apologies for the elementary nature of the question (yes, I'm another
newbie)...
I'd like to perform a multiple regression on a single data set containing a
representation of energy consumption and temperatures containing account
number, usage (KWh), heating degree days (HDD) and cooling degree (CDD)
days. I want to get the coefficients back from the following equation:
lm(AvgKWh ~
2018 May 18
3
Exporting to text files
I have dose response data analyzed with the package 'drc'.
'summary(mymodel)' prints my kinetic parameters. I want
that text in an ASCII text file. I want to get exactly what I
would get if I copied and pasted from the terminal window.
I've read the documentation on data export to text files here:
2007 Dec 06
3
number_to_currency
I am using the number to currency function because i live in the uk and
the company want me to only show values of the pound of course.I have
created all my application using ruby script/generate
scaffold_resource.... I have come across with a problem... this code is
in my applcation:
def number_to_currency(number, options = {})
options = options.stringify_keys
precision, unit, separator,
2006 Nov 16
2
dynamically adding static (class) methods to a class
Hello again,
I guess this is more of a Ruby question, but here goes anyways...
I want to intercept all calls to non existent class methods and then
call an existing class method with the non existent name.
In code...
class MyModel < ActiveRecord::Base
def MyModel.method_missing(symbol, *args)
MyModel.func(symbol.id2name)
end
def MyModel.func(func_called)
puts "You
2006 Feb 28
12
Examples for Money library ?
Can anybody share some examples of their Money implementation ?
I''m trying to setup a Model to use this library, but can''t seem to wrap my
head around how it is exactly supposed to work.
My Model (Foo) looks like:
===============
composed_of :commission, :class_name => "Money", :mapping => [
%w(commission_cents cents), %w(commission_currency currency) ]
Yet, in