Hello, new to Ruby on Rails, trying to configure the home page of my application. I don't know what I'm doing wrong, or how to configure the :home controller, but I get this error with this routes.rb file.
Routing Error - No route matches "/"
Here's routes.rb
SchoolCMS::Application.routes.draw do
devise_for :teachers, :admin
res...
I'm trying to define a route in routes.rb and I can't do anything from this Ruby on Rails routing guide that will let this error pass.
No route matches {:controller=>"devise/home"}
Here's my routes.rb source.
SchoolCMS::Application.routes.draw do
root :to => "home#index"
devise_for :teachers, :admin
resources :home, :only => ...
Is there any plugin/gem or an easy way for accomplish a pagination functionality like Twitter?
This means, showing a "More" button that shows more posts (for example) below once it's clicked, using Ajax.
If there's any easy way for modifying something from will_paginate plugin, that would be useful too.
...
I use authlogic for authentication and certain actions require a logged in user, which is controlled via a before_filter like the following. I also use friendly_id on the User model and internally everything there is a look up on the User model there are queries to the friendly_id slug table too. This results in at least 3 queries for ce...
I'm trying Ajax Will Paginate plugin. For further info click here.
My view's code is:
<h4>Top Ten</h4>
<div id="top_ten_results">
<p>
<table border="0">
<% unless @top_ten_posts.nil? %>
<% @top_ten_posts.each do |p| %>
<tr>
<td><%= link_to p.title, p %></td>
</tr>
<tr>
...
So I am doing a lynda.com Rails essential training tutorial, and I am getting an error that the video tutorial does not. I assume this has to do with the different versions of Ruby & Rails that I am using (the latest as of today) as opposed to the ones they used when this was recorded (I think in 2007).
This is what my controller looks ...
I'm writing a quick little money tracking rails app for fun that allows a user to enter their daily bills. I have a user embeds_many :bills.
I'm using Devise for auth. Here's my question. When I fetch current_user each time from my session_id, it's going to pull in my whole user and its embedded docs correct? So as bills add up, my ...
How would you implement a modal window saying "In order you to access this area you have to be logged in.." in combination with a login form below it every time a user tries to access authorized content.
I'm using Rails 3, Devise and CanCan.
My first thoughts were do put it somewhere in the application_controller.rb:
# application_cont...
Hello!
Been trying to get my project up and running on an Ubuntu Virtual Box machine. Everything works fine from the terminal, but when I try to run my application from Netbeans I get the following error:
=> Booting WEBrick
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
/home/soroush/.gem/ruby/1.8/gems/rails-2.3.5/lib/rails...
Hi,
I'm having an issue with one user. No matter what he does he ends up getting throwing an ActionController::InvalidAuthenticityToken error. I have tried having him clear his browser's cache, cookies, etc. He gets this using both FireFox and Internet Explorer. I'm at a loss as to why this would be occurring for just him. Everythin...
Is it faster to do a single database query that finds all the results you need for a page, then do several loops through it with if/else statements to extract what you want to show in each section, or to do several database queries selecting the exact data you require and then just loop through each one separately?
For instance:
@compl...
Let's say I have a Students table on my main page, with Country, Name, Age columns.
Suppose I want to have a dropdown box that lets users filter students by country, and also a search box that lets users search for students with a particular name.
I know how to create the country dropdown filter by itself:
<% form_tag('/students', :met...
Hello.
I'm having difficulty setting up JQuery Autocomplete with Rails3. I don't get any errors, it just behaves like regular text box.
Here is what I have done:
First I installed autocomplete as explained here: http://github.com/crowdint/rails3-jquery-autocomplete#readme
I have a model class which contains the model which will be ...
Are there any free GUI tools that will allow me to view the contents of my RoR sqlite3 DBs?
...
My default character encoding is Western (ISO latin 1, ISO-8859-1). I am using this code to change the character set:
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
My website only displays properly when I click on "Text Encoding" then "Western (ISO latin 1)" in the Safari view menu. Even when set on defau...
Newbie here...I am just going through, what is clearly, an old rails tutorial.
To create a form they have the following code:
<%= start_form_tag(:action => 'create')%>
<%= text_field(:album, :title) %><br />
<%= text_field(:album, :artist) %><br />
<%= text_field(:album, :genre) %><br />
<%= datetime_s...
I would like to know how I can reproduce the following query as map reduce or any juice function from MongoMapper or MongoID:
Event.find(:all,:select=>'events.company,SUM(price) as total_price',
:group=> 'company',:order => ' total_price DESC, created_at DESC')
...
I am developing a (currently) Rails 2.3.x application with a PostgreSQL 8.4 database backend. In my Rails application, I have a model corresponding to a database table that has two columns of datatype SERIAL and set as NOT NULL. I have one of these columns set as the primary key in both Rails and as a PostgreSQL constraint.
Table defin...
I am trying to install Diaspora. When I bundle install in Windows, I encounter some problems which include
Fetching http://github.com/BadMinus/devise.git
C:/Ruby Installation/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.2/lib/bundler/ \
source.rb:550:in ``': No such file or directory - git clone \
"http://github.com/BadMinus/devise.git" \...
I'm fairly new to rails so forgive me if I'm making some dumb mistake here. I'm trying to make an ajax call with link_to, and respond to a js.erb template. It isn't going so well. The link renders correctly:
<a href="/show" data-method="post" data-remote="true" rel="nofollow">Click</a>
The barebones show action:
def show
respond_t...