I am using aptana radrails
empty rail project :
scaffold Article titre:string body:text categorie_id:integer ordre:integer
Migrate - it works fine
scaffold Categorie titre:string ordre:integer
It generate the files but when i access http://127.0.0.1:3000/categories i have the following error :
NameError in Categories#index
Showing app/views/categories/index.html.erb where line #22 raised:
undefined local variable or method `new_categorie_path' for #
Extracted source (around line #22):
19:
20:
21:
22: <%= link_to 'New categorie', new_categorie_path %
i deleted recreated my whole rails project a few times, changed categorie with another name but it keep failling. Why ?
Right now I cant find a way to generate a callback between lines 1 and 2 here:
f = Foo.new
f.some_call
f.save!
Is there any way to simulate what would be effectively an after_new callback? Right now I'm using after_initialize but there are potential performance problems with using that since it fires for a lot of different events.
Is there a way in word to save a selected portion into the database as range object.So that we can later retrieve it .
It is required to generate a report in word ,the section needs to be repeated many times.
I have searched net for quite some time but not much material is found.
thanks.
Hi,
I have a pom.xml that uses cxf-codegen-plugin to generate a couple of WS clients.
Inside the configuration of cxf-codegen-plugin, there are the WSDL locations.
I would like to externalize those strings to a env.properties file.
I used org.codehaus.mojo's properties-maven-plugin to look inside src/main/resources/conf/app/env.properties.
How can I make Hudson to replace those properties with the apropiate host?
Thanks in advance
I'm using Kohana validation library and I want to set up my own user friendly error messages. The problem is that I generate the form dynamically, so field names are not know during development.
Can a set up error messages for the different validation rules (required, digit, ...) regardless the field name? How?
Note: I'm using Kohana v2.3.4
Is there a way to access ruby variables in sass or do i have to make a custom function for it?
What im trying to do is to generate a stylesheet for each user so in the controller, i do something like:
def show
respond_to do |format|
format.css{render :partial => "styles"}
end
end
then in the view name _styles.haml i do this:
:sass
#header
:background url(user.banner.url)
is this possible at all?
Hi,
I've described my model using an Ado Entity Data Model file (*.edmx), and i wish now to generate my db schema and tables from it. Is it possible?
Thanks
Hi ,
I have generated a Google map key by login as a [email protected] . Is there any restriction in generating the number of keys for each user. Since we have 2 different domains and i need to generate key for that too.
Actually i am not sure about of how many keys the person who used this id has created..
And is there any way to find of how many keys had already been created for the same account previously???
I had been told to deploy a *.war file within tomcat and this application should be working fine.
But for an unknown reason all I get is:
System Exception: javax.servlet.jsp.JspException: ValidatorResources not found in application scope under key "org.apache.commons.validator.VALIDATOR_RESOURCES"
I know that this application has been developed with STRUTS and I can obtain the source. But as I am not a specialist in this field, I come to ask for some help.
Could you tell me what file could generate this exception please?
I'm trying to find a way to document AMD modules using JSDoc3.
/**
* Module description.
*
* @module path/to/module
*/
define(['jquery', 'underscore'], function (jQuery, _) {
/**
* @param {string} foo Foo-Description
* @param {object} bar Bar-Description
*/
return function (foo, bar) {
// insert code here
};
});
Sadly none of the patterns listed on http://usejsdoc.org/howto-commonjs-modules.html work for me.
How can I generate a proper documentation that lists the parameters and return value of the function exported by the module?
I have a controller Projects in my Rails app with:
caches_page :index
However, instead of the cached file being generated at /public/projects/index.html it is located at /public/projects.html.
The web server (currently Mongrel) looks for */ directories before *.html files. So the http://…/projects request is routed through Rails and my index cache file is never served.
How can I tell caches_page :index to generate the file at /public/projects/index.html instead?
Many tools are available for web service designing, programming and testing, commercial and free. But what is available in the area of documentation? Are there tools which can parse a WSDL and then generate a 'human-readable' documentation in HTML (or PDF)?
Hi Guys,
I have a database where 2 (or maybe 3 or 4) different applications are inserting information. The new information has IDs of the type GUID/UUID, but each application is using a different algorithm to generate the IDs. For example, one is using the NHibernate's "guid.comb", other is using the SQLServer's NEWID(), other might want to use .NET's Guid.NewGuid() implementation.
Is there an above normal risk of ID collision or duplicates?
Thanks!
Hibernate doesnt seem to generate a notnull constraint on a field I marked as naturalID. Is this normal?
@MappedSuperclass
public class AbstractDomainObject extends PersistentObject {
@NaturalId
private String code;
DB Schema: CONSTRAINT SYS_CT_47 UNIQUE(CODE)
There is no not null constraint here.
ASP.NET MVC helpers generates URLs with slash, I use <base /> tag for my project, so it possible to place application to folder. Is it possible to generate relative URLs without first slash?
Thanks!
I am looking to get a random record from a huge (100 million record) mongodb. What is the fastest and most efficient way to do so? The data is already there and there are no field in which I can generate a random number and obtain a random row. Any suggestions?
I am implementing a design where my layer would sit between client and server, and whatever objects i get from server, i would wrap it in a transparent proxy and give to the client, that way i can keep a track of what changed in the object, so when saving it back, i would only send changed information.
I looked at castle dynamic proxy, linfu, although they can generate a proxy type, but they cant take existing objects and wrap them instead.
Wondering if its possible to do with these frameworks, or if there any other frameworks that enable this...
Hello,
As a follow-up of this question (Message compiler replacement in Linux gcc), I have the following problem:
When using MC.exe on Windows for compiling and generating messages, within the C++ code I call FormatMessage, which retrieves the message and uses the va_list *Arguments parameter to send the varied message arguments.
For example:
messages.mc file:
MessageId=1
Severity=Error
SymbolicName=MULTIPLE_MESSAGE_OCCURED
Language=English
message %1 occured %2 times.
.
C++ code:
void GetMsg(unsigned int errCode, wstring& message,unsigned int paramNumber, ...)
{
HLOCAL msg;
DWORD ret;
LANGID lang = GetUserDefaultLangID();
try
{
va_list argList;
va_start( argList, paramNumber );
const TCHAR* dll = L"MyDll.dll";
_hModule = GetModuleHandle(dll);
ret =::FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_HMODULE|FORMAT_MESSAGE_IGNORE_INSERTS,
_hModule,
errCode,
lang,
(LPTSTR) &msg,
0,
&argList );
if ( 0 != ret )
{
unsigned int count = 0 ;
message = msg;
if (paramNumber>0)
{
wstring::const_iterator iter;
for (iter = message.begin();iter!=message.end();iter++)
{
wchar_t xx = *iter;
if (xx ==L'%')
count++;
}
}
if ((count == paramNumber) && (count >0))
{
::LocalFree( msg );
ret =::FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_HMODULE,
_hModule,
errCode,
GetUserDefaultLangID(),
(LPTSTR) &msg,
0,
&argList );
}
else if (count != paramNumber)
{
wstringstream tmp;
wstring messNumber;
tmp << (errCode & 0xFFFF);
tmp >> messNumber;
message = message +L"("+ messNumber + L"). Bad Format String. ";
}
}
::LocalFree( msg );
}
catch (...)
{
message << L"last error: " << GetLastError();
}
va_end( argList );
}
Caller code:
wstring message;
GetMsg(MULTIPLE_MESSAGE_OCCURED, message,2, "Error message", 5);
Now, I wrote a simple script to generate a .msg file from the .mc file, and then I use gencat to generate a catalog from it.
But is there a way to use the formatted strings as they contain %1, %2, etc. and NOT the general (%d, %s...) format?
Please note, that the solution has to be generic enough for each possible message with each posible types\ arguments order...
Is it possible at all?
Thank you.
hello! I am using php and i have written codes to allow a user upload a file. For testing purposes, i have saved the file to D:/final/temp/test.xls. Then i generate another file and save it to the same location. This file can be downloaded by the user.
But if an actual user would be using my application,
where should the location point to? Thanks!
what is the best way to create a gradient for a 2D polygon in OpenGL, (Linear, and Radial)?
Thanks
How can you generate textures for radial gradients on the fly?
I have installed Symfony2 on a iis 7 server with PHP 5.3.21 and everything works ok ( the php, the symphony demo page ).
I try to create my own helloWorld, as the tutorial says :
php app/console generate:bundle
I go Start-Run-CMD and put that line of code and it gives me back this :
could not open input file : app/console
and before anyone asks i am in the project directory when i perform this command
I put the PHP directory to the System PATH but the problem persists.
Our system is written completely in PHP.
For various business reasons (which are a given) I need to build the reports of the system using JasperReports.
What architecture should I use? Should I put the Jasper as a stand alone server (if possible) and let the php query against it, should I have it generate the reports with a cron, and then let the PHP scoop up the files and send them to the web client/browser...