Search Results

Search found 5 results on 1 pages for 'shmichael'.

Page 1/1 | 1 

  • Performing AJAX calls on the "new" controller

    - by shmichael
    In my rails app, I want to have a sortable list as part of an object creation. The best practice suggested Railscast adds the acts_as_list plugin and then initiates AJAX calls to update item position. However, AJAX calls won't work on an unsaved model, which is the situation with new. One solution would be to save the model immediately on new and redirect to edit. This would have a nice side effect of persisting any change so the user could resume work should he be interrupted. However, this solution adds the unwanted complexity of saving an invalid model, compromising rails' validation processes. Is there any better way to allow AJAX + validations without going into too much work?

    Read the article

  • Form to sort an index in rails

    - by shmichael
    I'm a newcomer to Rails. I want to build a simple form that determines the sort order of a list. I've implemented a form in the likes of - <%= radio_button_tag :sort, "rating" %> <%= label_tag :sort_rating, "order by rating" %> <%= radio_button_tag :sort, "name" %> <%= label_tag :sort_name, "order by name" %> And now I am unsure how to implement the sort at the controller/model level. The aspects I am puzzled about are: Where should the sort be performed How could the sort parameter be persisted How could the code be reused Right now, I can't even get the selected sort method to remain selected after a submit. I would most appreciate any guidance or reference to an example.

    Read the article

  • fastest way to upload an xls file into a database

    - by shmichael
    I have an xls file with ~60 sheets of data. I would like to move them into a database (postgres) such that each sheet's data is stored in a different table. What is the fastest way of creating these tables? I don't care about naming or proper typing of columns. The columns could all be strings for that matter. I don't want to run 60 different csv uploads.

    Read the article

  • Rails: updating an item along with associated items

    - by shmichael
    Suppose I have a simple to-do list application. The application contains two models: lists (have an owner and description) items (have name and due-date) that belong to a specific list I would like to have a single edit screen for a list in which I update the list attributes (such as description) and also create/delete/modify associated items. There should be a single "save" button that will commit all changes. Unless save is pressed, any change to the list and the items should be forgotten. I wasn't able to find an elegant best practice for this. Would greatly appreciate any suggestions and/or references to existing implementations.

    Read the article

1