Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8244967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:02:11+00:00 2026-06-07T22:02:11+00:00

I’ve rewritten a grails application so that its 3 domains are each available at

  • 0

I’ve rewritten a grails application so that its 3 domains are each available at what I believe are (mostly) correct/Restful URLs. Each controller for those domains has a single index action, and depending on which request.method is used and whether the id is passed, I have it ready to send off json replies or do save/delete/etc.

Within the gsp side of things, I have jquery, backbone, and underscore all loaded. I’ve double-checked, these load correctly and the respective APIs seem to be available from any code I stick into a script element.

However, despite this, I seem unable to make Backbone.js do anything useful at all. I’ve read through the documentation, at least a dozen tutorials/examples, and about 100 backbone-related questions here on Stackoverflow. The only thing that I seem certain of is that the Router functionality is of little interest in this particular project.

I’ve been told that I have a choice of whether to use DataTables or jqGrid as the grid widget for this application. I have no preferences either way, but if one is easier than the other considering Backbone.js, I’ll happily choose it. I have had some luck loading data into Datatables but only by writing it in into the GSP table directly.

I am aware that Backbone might not be the best choice for this, but I have little choice in the matter. To be quite honest, I’m not exactly sure what Backbone.js is trying to achieve.

What is the simplest, most minimal code that will tie Backbone and the REST stuff together, such that when a button is clicked in the row of the grid widget, that the relevant record is deleted? So that the relevant data is loaded into the grid widget in the first place, too, for that matter? So that I can add/insert records from arbitrary html inputs in the bottom row of the grid, or to edit existing records listed there?

I can supply whatever code is needed, but it didn’t seem needed… I think I have the Grails side down pretty close to what is required, and thought it would only clutter up the page. Apologies in advance for the rambling, trying to refine as I write it into a question you guys have a chance of answering.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T22:02:14+00:00Added an answer on June 7, 2026 at 10:02 pm

    Define the url-attribute for each model and collection to represent the RESTful url that corresponds to that model or collection. This can be either just a string or a function that returns a string:

    url: 'path/to/my/collection-or-model' // string
    
    url: function() { // function
      return 'type-of-collection-or-model/' + this.identifyingAttribute 
    }
    

    Now you have the trail to your backend complete. Next up is CRUD (create, read, update, delete) -time!

    model.save() // Saves your model, if it is new this will be a POST request, otherwise PUT
    
    model.fetch() // Retrieves your model from the backed, this will be a GET request
    
    model.destroy() // Destroys your model and removes it from the backed as well, a DELETE
    

    you can also fetch entire collections with the collection.fetch() -function. The best place to get accurate information about Backbone and CRUD operations is backbonejs.org, if you want a more example-rich tutorial I would refer to the CRUD portion of the great Wine-Cellar tutorial for Backbone.

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I need a function that will clean a strings' special characters. I do NOT
I have a reasonable size flat file database of text documents mostly saved in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.