Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
{twitter.com/vikonava}[http://www.twitter.com/vikonava]
= AjaxCRUD
Gem for Rails that creates a convenient scaffold using Ajax in an unobtrusive way usign jQuery and jQueryUI.
This gem has been tested working on Rails 3.
== Requirements
== Setup
Add the gem to your Gemfile then run +bundle+ to install it.
gem 'ajaxcrud'
Install jQuery and jQueryUI(js and css) using assets on Rails 3.1 by adding the next line to app/assets/javascripts/application.js
//= require jquery //= require jquery_ujs //= require jquery-ui
And remember to also add the stylesheet and images included on jQueryUI to the app/assets/stylesheets/ folder.
== Usage
Theres only one command to run the generator and create a scaffold, and goes as follows:
rails g ajaxcrud NAME [field:type:boolean field:type:boolean]
Where NAME is the name of the model you are going to create. Additional to that field is the name of the attribute you are going to add and type is the type of field, just as a regular scaffold. The extra boolean in there is to indicate if that attribute is going to be indexed in the search field, it can be true, false or blank being false as default.
For example, if we are going to create a scaffold for Person which will include attributes name, address, website and phone_number being name and website the only attributes that are going to be indexed in the search field, we should run the following command:
rails g ajaxcrud Person name:string:true address:text website:string:true phone_number:string
This will create the Ajax scaffold and additional to that a general stylesheet to give some default color to the index table, an ajaxcrud helper to make index.html.erb more self-explanatory.
== Additional Configurations
You can configurate the default table to show more attributes that the one's indexed, just edit the show.html.erb file.
== Helpers
Helpers that are going to be added on index.html.erb are:
ajaxcrud_js(name, new_text, info_text) post a javascript required code inside your index file. Where name is the name of your model which in our example is person, new_text would be the text to show in the dialog box when a user is going to be created and also info_text works in a similar way but for the show dialog.
ajaxcrud_dialogbox(name) is used to post the code that build the dialog boxes on the file. Where name is the name of your model which in our example is person.
ajaxcrud_notices(name) is included in the place where notices will be shown in a flash[:notice] style but with some different finish. Where name is the name of your model which in our example is person.
ajaxcrud_search(name) is the search field used to look for in the table records. Where name is the name of your model which in our example is person.
ajaxcrud_new_link(name) creates the link to enable the New Record dialog. Where name is the name of your model which in our example is person.
ajaxcrud_show_link(path) creates the link to render the show.html.erb file of the selected record inside a dialog. Where path is the original way to access the show file.
== Known Bugs
== Special Thanks
This gem was made based on some of the tutorial made by 'Nikunj' at the {Tech Journey}[http://codefundas.blogspot.com/2010/12/create-ajax-based-curd-using-rails-3.html]'s website and being adapted to change or add some functionalities to that.
Also thanks to {Ryan Bates}[http://www.twitter.com/rbates] who helped me find out how to create my first generator and gem, and whose {website}[http://www.railscast.com] is awesome and has helped me a lot learning how to code in Ruby on Rails. Highly Recomended.
FAQs
Unknown package
We found that ajaxcrud demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.