Displaying 20 results from an estimated 2000 matches similar to: "Scaffold generator: create vs. new"
2013 Feb 27
3
an rsync question
Is there any way to have rsync compare against a file with a *different*
name?
What I'd like to do is compare a vm - whatsit.img against a backup -
whatsit.current, that's a symlink to whatsit.timestamp, and if different,
*then* make the copy (which my script will then move to
whatsit.newtimestamp, and change the symlink to point to the new one, then
remove the old (or maybe save an older
2006 Feb 08
2
URL rewriting
Here is the scenario I am trying to achieve. Basically, I want to run
the action "show" from my controller, without adding the "show/id".
Standard:
http://www.domain.com/controllerName/show/id
I would like:
http://www.domain.com/controllerName/randomstring (where randomstring is
a
field in my model/table, that is equivalent to a GUID -> and unique).
I''m confused
2006 Apr 20
4
Many to Many Category structure with itself
Basically, I''m trying to have a table called "categories" have a many to
many relationship with itself. But I also want each catagory to be able
to be "copied" into another category so it is essentially a child
category to more than one parent. To me the obvious way of doing this is
by creating another table called category_maps (and a model called
CategoryMap).
2010 Feb 11
3
Parameterized ActiveRecord Associations: Any such thing?
Hi list, how are ya?
So, my current project is just begging for the ability to have
parameterized associations in my ActiveRecord classes. Basically I
need something that is a cross between named scopes and standard
associations (has_many specifically).
I''m wondering if such a thing exists or, if not, if anyone else has an
elegant, equivalent solution?
Example:
class Sprocket <
2006 Jan 25
4
html special char conversion
I''ve stucked to such problem:
I have html entities in database, after using scaffold I''ve got these
chars not converted (I have strictly " and & in page source). It is what
I need, but after making ./script/generate scaffold modelname
controllername (recreating controller) I''ve got all special chars
converted into entities like (" and others). How can
2006 Feb 07
5
homepage instead of welcome page?
Got a noob question for ya...
When I visit http://localhost:3000/
I get the nice "Welcome to rails" page. To get to a controller I have to
go to:
http://localhost:3000/controllername
What if I don''t want the welcome message and want / to resolve to a
controller?
How do I set that up?
Thanks,
Dave
--
Posted via http://www.ruby-forum.com/.
2006 May 02
1
Accessing Parameters - Params (nil)
I''m trying to render a component that pulls information based on a
parameter that is passed by a link_to item, but my params object is nil
for the following code in the controller:
records = ControllerName.find(params[:id])
but the error page also has this: Parameters: {"id"=>"7"}
I''ve tried to access it (in the controller) using:
variable =
2011 Oct 25
0
Sprocket Digest + Debug combination broken?
Hi all,
we''re just in the process of upgrading to the new asset pipeline, but I''m
having an annoying issue with Sprockets.
It turns out that I can''t enable both *debug* and *digest* in development
mode. When I do, I get a Errno::ENAMETOOLONG because the digest becomes the
*entire* *content* of the file instead of a hex. I get this with both sass
and javascript.
2006 May 28
1
Changing module name - help!
When I started developing my application I grouped my controllers in the
followin g fashion: User::ControllerName.
Now I''ve realized that the ''User'' module is a misnomer for my current
controllers and I need to use the User module for something else, so I
decided to change the controllers in the ''User'' module to ''Data''.
2011 Sep 28
3
Error : bundle install
c:proj/proj1> bundle install
Fetching source index for http://rubygems.org/
Could not find sprockets-2.0.0.beta.10 in any of the sources
C:proj/proj1>
C:proj/proj1>gem install sprockets -v=2.0.0.beta.10
ERROR: Could not find a valid gem ''sprockets'' (= 2.0.0.beta.10) in any
reposito
ry
ERROR: Possible alternatives: sprockets
C:proj/proj1>gem install sprockets
2012 Dec 18
2
cache-busting non-digest assets in sprockets in development a good idea? should headers in sprockets be configurable?
Just monkey patched Sprockets in our Rails 3.2.9 app to override the
Cache-Control header for html assets that we need to tweak more often in
development, but that we don''t want to use digests/fingerprinting with:
# Sprockets 2.x patch
if Rails.env.development?
module Sprockets
module Server
private
alias_method :sprockets_headers, :headers
def headers(env,
2006 Feb 01
3
Testing components
I''m using template components to modularize an application I''m working
on and am really happy with the way it''s going. Unfortunately, all my
attempts at writing functional tests for them fail. Trying to duplicate
my normal controller tests I have:
require File.dirname(__FILE__) + ''/../test_helper''
require File.dirname(__FILE__) +
2006 Jan 08
4
Rails table pluralizing Issue
Hi,
I am working on a table with name "addresses". However when I do a
ruby script/generate scaffold Address, I am not able to access
http://localhost:3000/addresses. I am getting the following error.
uninitialized constant Addres
This error occured while loading the following files:
addres.rb
How do I resolve this issue.
Thanks
Silvy MAthews
2012 May 07
1
Sprockets, JST, Eco and escaping
While it was a good move from Rails part to escape ERB <%= %> tags by
default, it doesn''t seem to happen to Sprockets as well.
The strange bit is that according to Sprockets documentation, it would
be just a matter of naming your template as .jst.eco to enable Eco:
https://github.com/sstephenson/sprockets#javascript-templating-with-ejs-and-eco
Then, extracted from Eco
2006 Feb 12
6
Including another helper
I need to include another helper module apart from the normal two
(ApplicationHelper and [controllername]Helper). The inclusion needs to
be dynamic and based on external parameters (ie what helper that get
included differ from request to request).
Is it possible? How?
/Marcus
2006 Feb 28
10
Scaffold command, how and what may be wrong?
hi everyone. I am learning RoR and just recently purchase the agile wed
dev on rails. i am still at the beginning of the book trying to create
the scaffold for the depot_development database. Everytime i run the
generate scaffold products admin, i recieve the "before building the
scaffold, try to create a table for model products" etc...
a few questions:
1. How does ruby know that
2010 Apr 03
0
Deployment problem with apache + fastcgi
Hi! I''m from Russia. It''s my first post in this forum. Execuse for my
bad language, but i hope you''re help me!
I try to deploy rails app on apache + fastcgi hosting.
.htaccess file contents:
AddHandler fcgid-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI
RewriteEngine On
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
2006 Mar 24
3
Pilot to Bombardier
do you read me? Testing, one, two, three... not seeing my post --
just want to make sure its working.
2011 Nov 10
1
url helper in model.js.erb.cofee (Sprockets::Context)
hello,
I am writing a js/coffee file that gets erb handling and I need to use
a url helper inside this file
if write
..
url: ''<%= url_for(:action => :index) %>''
I get an error:
NoMethodError Exception: undefined method `url_for'' for #<#<Class:
0xbdbb068>:0xeed1eb8>
>>self.class
#<Class:0xbdbb068> < Sprockets::Context
How do I
2007 Feb 26
15
drbspec - "no server running"
At times I''ve gotten the message "No Server Running" from drbspec
with my rails app. The thing is, the drb server certainly is running!
This happened a few times with my model specs. I''m not sure exactly
what the problem was there - I believe I was loading up fixtures that
didn''t exist. I was calling fixtures :singular_table_name as opposed
to