Tag: ruby-on-rails-3.1

how to set working the Words gem for my rails app

I want to use words – interface to WordNet® with cross ruby distribution compatability,for my application. How to set all the essential prerequisites to get this done aprt from installing the gem.

Managing gems from admin interface

I’m writing rails application with plugins support. Plugins are rails 3.1 engines in the form of gems. These plugins can contain migration, custom routes etc. My customer wants to be able in future to install new plugins by themself with a web-based interface. And my customer does not know anything about git, bundler, rails, deploying […]

rails 3.1 updating css issues

I just updated from 3.0.8 to rails 3.1 rc1. However,the css in my site is clearly not being accessed beacuse my site has no design anymore. I though i could fix it by creating an assets folder and placing my stylesheets and js inside the app/assets folder but that hasn’t worked. I also commented this […]

Cant get tabulous gem to render controller action views on same page without tabs disappearing

I am a ruby on rails newbie and developing a rails 3.1 app which includes tabulous gem with twitter-bootstrap and formtastic-bootstrap gems. I have a control panel in my application under a namespaced area. Under the namespaced area in the views directory, I have a control panel directory with view pages underneath it that don’t […]

Rails 3.1 assets not loading properly in production for ActiveAdmin

I’m using ActiveAdmin with Rails 3.1. The only images (that I’m aware of) that this gem uses are sorting arrows in the header rows of tables. In development, the CSS properly references these images: table.index_table th.sortable a { background: url(“/assets/active_admin/orderable.png”) no-repeat 0 4px; padding-left: 13px; } In production, the CSS does not properly reference these […]

rails 3.1 dynamic controller instantiation

I have a Rails Engine gem in which I want to load a HomeController class definition dynamically from an initializer. I can instantiate the class correctly, but when I go to call the index action, I get this error : TypeError in HomeController#index can’t convert nil into String Rails.root: /home/chris/test_app Full Trace: actionpack (3.1.0) lib/action_view/template/resolver.rb:16:in […]

Rails Javascript if else condition using variable from Controller

View <%= link_to “Link”, {:action => “AjaxView”,:col => “colname”}, :update => “Ajaxcall”, :remote => true %> Controller def AjaxView @vars= Var.find(:all,:conditions => { :varName=> “one” },:select=>(params[:col])) respond_to do |format| format.js { render :layout=>false } end end AjaxView.js.erb if ( (<%= col %>) == “colName”) { $(“#3”).text(“<%= escape_javascript(render(:partial => “var”) %>”); } else { $(“#2”).text(“<%= escape_javascript(render(:partial […]

cancan is not calling the ability method

I want to limit the access to read the lead for a user. I have the relation as : Account has many office and Account also has users. And Office has leads. Now only the user associated with the office can view its lead. I have defined the ability as : can :read, Lead do […]

How can I convert this form_tag form into a form_for form in ruby on rails?

I’ve been trying to figure out how to write a form_for version of this form for my passwords_controller. I have resources :passwords in my routes.rb file. I looked at my login form and even though it doesn’t really access the model I still used form_for and it worked. I tried the same thing and I […]

My build method is no longer working in ruby on rails

After spending days working on the user profile section of my website I’ve now found that build_profile does not work. I don’t know what is wrong,it doesn’t make sense as it was working perfectly fine the other day. Now it doesn’t create a row in the profiles table every time a new user is created. […]

Ruby is the best programming language in the world - Ruby on Rails.