Search Results

Search found 9989 results on 400 pages for 'grails controller'.

Page 17/400 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • Cannot call action method 'System.Web.Mvc.PartialViewResult Foo[T](T)' on controller 'Controller' be

    - by MedicineMan
    Cannot call action method 'System.Web.Mvc.PartialViewResult FooT' on controller 'Controller' because the action method is a generic method <% Html.RenderAction("Foo", model = Model}); %> Is there a workaround for this limitation on ASP MVC 2? I would really prefer to use a generic. The workaround that I have come up with is to change the model type to be an object. It works, but is not preferred: public PartialViewResult Foo<T>(T model) where T : class { // do stuff }

    Read the article

  • Rails controller method going to plural form

    - by Jty.tan
    I'm new to rails! Ok, I am trying to set up a user signup form. It is mapped as a singular resource in the routes map.resource :user And trying to create the user through the console works fine. the controller code for user's signup is as follows: def signup @user = User.new#(params[:user]) end def create @user = User.new(params[:user]) #debugger if request.post? if @user.save session[:user] = User.authenticate(@user.login, @user.password) flash[:message] = "Signup successful" redirect_to registries_path else flash[:warning] = "Signup unsuccessful" #redirect_to 'user/signup' end end end The signup view is as follows (and this is where i think something is going wrong) <% form_tag user_path do %> <p>User creation.</p> <p><%= error_messages_for 'user' %></p> <p> <label>Username:</label> <%= text_field_tag 'login', nil, :size => 20, :maxlength => 20 %> </p> <p> <label>Password:</label> <%= password_field_tag 'password', nil, :size => 20, :maxlength => 20 %> </p> <p> <label>Password confirmation:</label> <%= password_field_tag 'password_confirmation', nil, :size => 20, :maxlength => 20 %> </p> <p> <label>Email:</label> <%= text_field_tag 'email' %> </p> <p><%= submit_tag 'Signup' %></p> <% end %> Now, that page renders just fine. I've called the form on the "user_path" which is singular (i think?). But when I hit the submit button, it gives me an error saying that uninitialized constant UsersController the occurence of the error makes sense, since User is meant to be singular, so if it is trying to call the Users controller, it should be chucking an error. When I checked the server log, it shows this message: Processing ApplicationController#create (for 127.0.0.1 at 2010-05-08 16:26:14) [POST] Parameters: {"commit"=>"Signup", "password_confirmation"=>"[FILTERED]", "action"=>"create", "authenticity_token"=>"yOcHY+rMjaqmu9HS8EwnDqJKbc0Zxictc0y4dtD26ac=", "controller"=>"users", "login"=>"bob", "password"=>"[FILTERED]", "email"=>"[email protected]"} NameError (uninitialized constant UsersController): In the params, I can see that it is calling the "users" controller. But I'm not sure how to fix that, or what is causing it to call the "users" controller as opposed to the "user" controller. Any ideas? Thanks in advance!

    Read the article

  • Grails YUI- Datatable complete refresh

    - by geeronimo
    Hi, I have inserted a paginator for my YUI-Datatable. Now I want to refresh my whole page, when the user has changed the view in my Datatable. YUI makes just a refresh (remoteCall) for itself, but I need a refresh for the whole page, because I want to update my Flashanimation too. For any sugest I would be very grateful, Geeron imo Here´s the code for my datatable: paginatorConfig="[ template:'{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {CurrentPageReport}', pageReportTemplate : '{startRecord} - {endRecord} von {totalRecords}', containers:'dt-paginator', firstPageLinkLabel: '&lt;&lt;', lastPageLinkLabel: '&gt;&gt;', previousPageLinkLabel: '&lt;', nextPageLinkLabel: '&gt;' ]" />

    Read the article

  • rendering JSON in GRAILS with part of the attributes of an object

    - by bsreekanth
    Hello, I am trying to build JSON from two fields. Say, I have a list of object(party), and I only need to pass 2 items as JSON pair. def list = getMyList() //it contains 2 party objects partyTo = array { for (i in list) { x partyId: i.id y partyName: i.toString() } } The JSON string is {"partyTo":[ {"partyId":12}, {"partyName":"Ar"}, {"partyId":9}, {"partyName":"Sr"} ] } when I extract it at the client, it is treated as 4 objects. I wanted as 2 objects, with the below format. {"partyTo":[ {"partyId":12 , "partyName":"Ar"}, {"partyId":9 , "partyName":"Sr"} ] } I'm getting 4 objects, probably because I use an array to build JSON. I'm new to groovy and JSON, so not sure about the right syntax combinations. Any help highly appreciated. thanks.

    Read the article

  • Grails 1.2.1 Tomcat SSI configuration

    - by Visionary Software Solutions
    Neither a Tomcat nor SSI pro, I'm trying to use a provided template that relies on them heavily for look and feel. The Tomcat page says that SSI is disabled by default. It's installation instructions talk about renaming a Catalina.jar file, which I cannot find in $GRAILS_HOME. How can I configure the bundled Tomcat instance for SSI?

    Read the article

  • Grails checkbox

    - by Tomáš
    Hi gurus I have trouble with binding Boolean property in association classes. Property is set to true if I check checkbox (good), but is null if checbox is not checked. I know the problem with HTML checkbox. I know why is send "_fieldName" in params, but this "_fieldName" dont set my boolean property to false. class Person{ String title List<Group> groups = new ArrayList() static hasMany = [groups: Groups] } class Group{ String title Boolean isHidden static belongTo = Person } class PersonController{ def form = { def person = new Person() person.groups.add( new Group() ) return ["person": person] } def handleForm = { def person = new Person( params ) println person.groups[0] } } If I check checkbox: [isHidden:on, title:a, _isHidden:] println person.groups[0] //true If I don check checkbox: [title:a, _isHidden:] println person.groups[0] //null Thank a lot for help Tom I am sorry, I searched this web, but did not get actual info for my trouble.

    Read the article

  • Grails / GORM, read-only cache and transient fields

    - by Stephen Swensen
    Suppose I have the following Domain object mapping to a legacy table, utilizing read-only second-level cache, and having a transient field: class DomainObject { static def transients = ['userId'] Long id Long userId static mapping = { cache usage: 'read-only' table 'SOME_TABLE' } } I have a problem, references to DomainObject instances seem to be shared due to the caching, and thus transient fields are writing over each other. For example, def r1 = DomainObject.get(1) r1.userId = 22 def r2 = DomainObject.get(1) r2.userId = 34 assert r1.userId == 34 That is, r1 and r2 are references to the same instance. This is undesirable, I would like to cache the table data without sharing references. Any ideas?

    Read the article

  • Grails multiple databases

    - by srinath
    Hi, how can we write queries on 2 databases . I installed datasources plugin and domain classes are : class Organization { long id long company_id String name static mapping = { version false table 'organization_' id column : 'organizationId' company_id column : 'companyId' name column : 'name' } } class Assoc { Integer id Integer association_id Integer organization_id static mapping = { version false table 'assoc' id column : 'ASSOC_ID' association_id column : 'ASSOCIATION_ID' organization_id column : 'ORGANIZATION_ID' } } this is working : def org = Organization.list() def assoc = Assoc.list() and this is not working : def query = Organization.executeQuery("SELECT o.name as name, o.id FROM Organization o WHERE o.id IN (SELECT a.organization_id FROM Assoc a )") error : org.hibernate.hql.ast.QuerySyntaxException: Assoc is not mapped [SELECT o.name as name, o.id FROM org.com.domain.Organization o WHERE o.id IN (SELECT a.organization_id FROM AssocOrg a )] How can we connect with 2 databases using single query ? thanks in advance .

    Read the article

  • Grails- Unique constraint

    - by WaZ
    How can I basically carry out a unique constraint on a string data-type field. class User{ String username String Email static hasMany = [roles:Roles] static constraints = { Email(email:true) username(unique:true) } Is there any simple way to implement username(unique:true) or I will have to manually check the database by the in-built methods like .findByNameLike. My need is that username should be unique and should be case insensitive

    Read the article

  • Grails Date Property Editor

    - by Jan
    Hey folks, i'm using the jQuery UI datepicker instead of the <g:datePicker>, which is changing the selected date in a textbox. Now I want to save this neatly back into my database, and came across custom property editors. click me hard to see the topic on StackOverflow However, adding this custom PropertyEditor didn't change anything, dates are still displayed like '2010-01-01 00:00:00.0' and if I try to save a date it crashes with Cannot cast object '05.05.2010' with class 'java.lang.String' to class 'java.util.Date'. Is there any additional magic needed, like a special naming of the textbox or something like that? Thanks for your help, Jan

    Read the article

  • Grails/Groovy taglib handling parsing dynamically inserted tags.

    - by Dan Guy
    Is there a way to have a custom taglib operate on data loaded in a .gsp file such that it picks up any tags embedded in the data stored in the database. For instance, let's say I'm doing: <g:each in="${activities}"> <li>${it.payload}</li> </g:each> And inside the payload, which is coming from the database, is text like "Person a did event <company:event id="15124124">Event Description</company:event>" Can you have a taglib that handles company:event tags on the fly?

    Read the article

  • Grails efficient hasMany-Relationship in View

    - by Jan
    Hi folks, I'm saving contacts (email, mobile phone, ICQ, AIM etc.) for people like this: class Person { static hasMany = { contacts: Contact } } class Contact { String code ContactType type } class ContactType { String name } In my view, I've written some Templates for displaying each contact with a select-box for the contact-type and a textfield for the code, spiced up with some JavaScript for adding and deleting. My question is: Is there an easy and elegant way to update the data similar to personInstance.properties = params or do I have to read out all the fields, deleting removed, updating changed and adding new ones?

    Read the article

  • Grails - Self Join

    - by WaZ
    Hi, When I write the following class, I get the following compilation error: could not resolve property How can I achive the following: class Employee{ String Name String Email Employee Manager static hasMany = [desginations:Designation] static constraints = { Name(unique:true) Email(unique:true) } Thanks, Much appreciated.

    Read the article

  • Grails withCriteria testing

    - by Steve Wall
    Hello, I'd like to test a "withCriteria" closure and am not sure how to go about it. I see how to mock out the withCriteria call, but not test the code within the closure. When running the test that executes the "withCriteria", I keep getting a MissingMethodException, even though the code runs fine under the normal flow of execution. Any ideas? Thanks! Steve

    Read the article

  • Using Google and Yahoo OpenID service in Grails ACEGI

    - by firnnauriel
    I am using acegi-0.5.2 and was able to make myOpenID account work (had to add http://.myopenid.com/ in the database). Now, I'm wondering how to make the Google and Yahoo openid URL work. I'm using these URLs: https://www.google.com/accounts/o8/id http://yahoo.com/ Any help on how to make them work? Do i need to install this plugin? Thanks in advance.

    Read the article

  • Groovy on Grails: GORM and BitSets?

    - by Visionary Software Solutions
    I don't see anything in the official documentation about unsupported persistence data types, so I'm working under the assumption that types available in the Groovy language should be handled. However, for the following domain class: class DocGroupPermissions { Workgroup workgroup; Document document; BitSet permissions = new BitSet(2) public DocGroupPermissions() {} void setPermissions(boolean canRead, boolean canWrite){ setReadPermissions(canRead) setWritePermissions(canWrite) } BitSet getPermissions() { return permissions } void setReadPermissions(boolean canRead) { permissions.set(0,canRead) } void setWritePermissions(boolean canWrite) { permissions.set(1,canWrite) } boolean getReadPermissions() { return permissions.get(0) } boolean getWritePermissions() { return permissions.get(1) } static belongsTo = [workgroup:Workgroup, document:Document] static constraints = { workgroup(nullable:false, blank:false) document(nullable:false, blank:false) } } I'm getting: 2009-11-15 16:46:12,298 [main] ERROR context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageSource': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.MappingException: An association from the table doc_group_permissions refers to an unmapped class: java.util.BitSet Has anyone run into this before?

    Read the article

  • Find Object in Many-to-Many Szanario - Grails

    - by Oliver
    Hello, i got this situation: - class user with hasMany Roles and belongsTo Roles - class Role with hasMans User how can i get the roles belongs to a user, object user is given, how can i get objects in a many-to-many szanario? findByX doesn't work, it's affect just one table, but i need a "find" or something else to find Object overall / over many tables. can anyone help me? and excuse my no propper english^^

    Read the article

  • How to use more parameters in help-ballon grails-plugin

    - by servicesskurt
    I try to use more of the parameters but could not get it working with <g:helpBalloon title="foo" content="bla" useEvent="['mouseover']" /> should result in <script type="text/javascript"> new HelpBalloon({ title: 'foo', content: 'bla', useEvent: ['mouseover'] }); </script> but useEvent="['mouseover']" seems not to be recognized?! as seen on http://www.beauscott.com/examples/help_balloons/doc/examples.htm

    Read the article

  • issue getting dynamic Config parameter in Grails taglib

    - by Mick Knutson
    I have a dynamic config parameter I want to get like: String srcProperty = "${attrs ['src']}.audio" + ((attrs['locale'])? "_${attrs['locale']}" : '') assert srcProperty == "prompt.welcomeMessageOverrideGreeting.audio" where my config has: prompt{ welcomeMessageOverrideGreeting { audio = "/en/someFileName.wav" txt = "Text alternative for /en/someFileName.wav" audio_es = "/es/promptFileName.wav" txt_es = "Texto alternativo para /es/someFileName.wav" } } While this works fine: String audio = "${config.prompt.welcomeMessageOverrideGreeting.audio}" and: assert "${config.prompt.welcomeMessageOverrideGreeting.audio}" == "/en/someFileName.wav" I can not get this to work: String audio = config.getProperty("prompt.welcomeMessageOverrideGreeting.audio")

    Read the article

  • Grails and googleJsonAPIService

    - by Calahad
    I am using the googleJsonAPIService to manipulate users (CRUD). This is how I get the Directory instance: def getBuilder() { def builder def httpTransport = googleJsonAPIService.makeTransport() def jsonFactory = googleJsonAPIService.makeJsonFactory() def requestInitialiser = googleJsonAPIService.getRequestInitialiser() builder = new Directory.Builder(httpTransport, jsonFactory, requestInitialiser); return builder } Directory getGoogleService() { Directory googleService = getBuilder().build() return googleService; } Once I have this service, I use it to get a user's details (in my own service) for example: def query = getGoogleService().users().get(id) return handleException { query.execute() } I manually populate a DTO with the result of that query, and this is where my question comes: Is there an elegant way to have this mapping (object returned to DTO) done automatically so all I have to do is pass the class of the object to be returned? This is the structure of the object returned by google : ["agreedToTerms":true,"changePasswordAtNextLogin":false, "creationTime":"2013-11-04T04:33:35.000Z", "emails":[{"address":"[email protected]","primary":true}],...]

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >