Displaying 20 results from an estimated 1000 matches similar to: "dynamically generating a controller and appropriate routing"
2007 Apr 23
1
Package installed, functional but not available
Hello,
when I run packageStatus(), I get the following results:
> packageStatus()
Number of installed packages:
ok upgrade unavailable
/home/fernando/my_library 38 0 1
/usr/local/lib/R/library 28 0 0
Number of available packages (each package/bundle counted only once):
installed
2006 Jun 17
0
Dynamic forms containing collections
Hiall,
I have the following problem: I need to use forms containing
collections (i will call them FCC), and I want to construct them
dynamically, as I need to deal with quite large forms (more than 600
input fields).
The variables @model_name and @field_name contain the proper model and
field names as strings, which is enough for "normal" form input
fields. (i.e. the "if
2012 Apr 25
2
Rails 3.1 - Scaffolding Files
Where can I find more information about the new syntax on these:
<%- model_class = @product.class -%>
<h1><%=t ''.title'', :default => t(''helpers.titles.new'', :model =>
model_class.model_name.human,
:default => "New
#{model_class.model_name.human}") %></h1>
<%= render :partial =>
2006 Jun 18
2
using javascript to get an attribute using an ID
Hi everyone,
I''m trying to use ajax to update the selected value of a select element.
Here''s what I have so far:
function RailsModel(model_name)
{
this.model_name = model_name;
}
RailsModel.prototype.getAttributeById = function(attribute, id)
{
Ajax.Request(''/models/get_attribute_by_id/'' + this.model_name + ''/'' +
attribute +
2006 Aug 04
4
DRY DRY DRY
Hello everyone!
Ive been on rails for the last month or so and really enjoyed this
framework.
However its very hard to find documentation on how to do things right!
For example every beginner after a while realizes that having similar
CRUD actions in every controller and views for them is not DRY at all!
Few days ago I found http://dereksivers.com/rails-shared-controller.html
I quite like his
2006 Feb 20
2
file_column: changing default store_dir
File_column plugin is great. I need to change the default :store_dir
from the dynamic "model_name/attribute_name" to an equally dynamic
"client_id/app_id/model_name/attribute_name". In my model I have:
class Component < ActiveRecord::Base
belongs_to :component_type
belongs_to :component_group
breakpoint
file_column :content,
:magick => { :versions
2007 Mar 19
0
action_web_services error with rspec_on_rails
I now have two specs in my rails project which correspond to one
rails controller. I can run them individually and they pass, but
running them together (either with the rake task just putting both
files on the command line):
euclid% spec spec/controllers/crud_resource_controller_spec.rb spec/
controllers/crud_resource_controller_with_join_models_spec.rb
2006 Apr 27
3
collection_select to display 2 fields
I''m trying to get a collection_select generated Drop-down box to display
two fields from a table (first name & last name); however, I am having
trouble concatenating the symbols. It appears as though any code I put
in the 5th argument for collection_select is processed prior to
executing the collection_select method. The code executes successfully
with 1 symbol in the 5th
2006 Mar 23
6
easy scaffold question(s)
I''m doing very well with the Hibbs Rolling on Rails tutorial. I have an
easy question for my personal notes. I''m coming up with a simple framework
of steps for creating a basic database. It includes the following maxims to
make original app creation easy:
app_name = MySQL database name
SQL_tablename = model_name
model_name = controller-name
Is this going to work for getting
2008 May 30
9
find_by_sql without a model? how to do this?
Hi,
I''d like to do a "find_by_sql" without a model (e.g. <model
name>.find_by_sql("...")) as the results I get back are a once off special,
and I''m happy to handle them as an array. How do I do this?
"ActiveRecord::Base.find_by_sql(...)" does not seem to work?
Background - At the moment I''m doing within a model <model_name>,
2006 Jun 12
0
Realtime form validation for forms containing collections
Hi,
I''m successfully using the realtime_form_validation plugin from
http://railsrtv.rubyforge.org/ However, my forms contain collections,
as described in the AWDWR book. Basically my form looks like this.
2004 2005 2006
Question 1 12 13 15
Question 2 9 11 13
I have the following code to generate ids for my input fields.
2012 Sep 03
0
undefined method `singular_route_key' for "User":ActiveModel::Name
In ActionDispatch::PolymorphicRoutes, there is a call to
build_named_route_call an on line 172 (of latest rails code from
github), there is a call to singular_route_key:
model_name_from_record_or_class(parent).singular_route_key
Now model_name_from_record_or_class returns an ActiveModel::Name
object, which is a wrapper to the string class, that returns a string
name of the class of an
2013 May 20
0
db connection returns stale values
Hello,
I''m working on a rails 3 app for a legacy oracle db.
I have a controller that saves object graphs
(accepts_nested_attributes_for) but I noticed the post-update JSON response
still contains the pre-update values.
After some debugging, it appears the database connection is returning stale
values (find(), reload(), etc., all return pre-update values; but SQL
clients and
2006 Jan 04
4
file_column
I use file_column and it works fine.
I tried to change the store_dir to a the path I want my files to be
stored and not the default.
I stored some images fine. But when I try to reach my images it seems
like file_column uses the model_name/attribute_name on the image and not
the store_dir I used. How can I change this ?
Thanks in advance
--
Alexander Antonakakis
2011 May 27
4
undefined method `model_name' for NilClass:Class in a form_for
Hi! I know that there are other topics about this issue, I read them and
I''m always blocked. Here is the error message:
undefined method `model_name'' for NilClass:Class
Extracted source (around line #30):
27:
28: <h2>Add Translation</h2>
29:
30: <%= form_for @new_trad do |f| %>
31: Locale: <%= f.text_field :locale %>
32: Key : <%=
2006 Jul 06
1
<model>.update(...) not calling before_update callback.
Hi,
I''m doing a <model_name>.update(....) but I''m noticing that my
before_update callback is not being called. If I do a find and then a
save!, I notice that it is called. The problem with a find and save in
my case is that I''m not able to set all my attributes in one shot by
saving params["user"] and since I can''t do this, my overloaded
2007 Aug 14
2
Finding a models asscoations
Hi,
I cant seem to find the answer to this anywhere so any help/advice is
appreciated.
Each project has one risk and a risk has a number of has/one belongs to
assocations. So what i want to do is in my code loop through all the
associations for a risk and display some field information from each as
they are pretty similar. So somehting like
<% for model_association in project.risks %>
2011 Aug 31
9
undefined method `model_name' for NilClass:Class in rails 3.0.0
Hi,
i got search which shows following error
ActionView::Template::Error (undefined method `model_name'' for
NilClass:Class):
1: <%= form_for(@employee) do |e| %>
2: EMP ID<%= e.text_field :id %><br>
3: <%= e.submit ''search'', :controller => ''employees'', :action =>
''search1'' %>
2006 Jul 31
6
Popup Calendar and DateBoxEngine and Change Made ...
Community,
I have been putting off implementing a Date selector for too long.
Tonight, I finally put it in. I made the choice to go with the datebox
engine.
Once I got it installed and working, I realized I didn''t like the way it
required you to call it. Example:
<% @dateField = model.date %>
<%= date_box %>
or...
<% @dateField1 = model.date %>
<%=
2011 Apr 06
1
Time to fix PartialRenderer#partial_path
For the longest time PartialRenderer#partial_path has prefixed the
prefix of the current controller when it is nested in a module. This
hasn''t been a problem (because nesting controllers wasn''t that common)
but with 3.1 striving for better engine support, this problem is now
larger because all of your controllers for an engine will be nested
and it makes doing <%= render