Ruby on Rails is an open-source web development framework written in Ruby. Ruby on Rails follows the principle of convention over configuration, freeing you from having to re-invent things to stay productive. Ruby on Rails 4.0 is the latest edge version available.
0
votes
2answers
12 views
Can I change the submit path the record identification creates for a form builder?
I'm using the scaffold-generated _form partial. The form_builder submit section looks like this:
<%= form_for(@party) do |f| %>
...
<div class="actions">
<%= f.submit %>
...
1
vote
1answer
41 views
Create a User with a different controller
Hey i'm making an app that has an invite system. When you are invited you receive an email allowing you to sign up as a user with that specific email. So I wanted my form (invitation#show) to allow an ...
0
votes
1answer
16 views
Rails logger messages not showing in development log
My development log seems to be working fine (it shows each asset that's loaded etc.) but it won't show any messages I put in code. I have:
Rails.logger.debug "My debugging message"
in a method ...
0
votes
0answers
7 views
how to properly configure sitemap.rb using sitemap_generator gem
Hey I'm getting very confused on how to properly configure my sitemap.rb file in the config directory using the sitemap_generator gem
if i have routes that look like this
namespace :products do
...
0
votes
1answer
28 views
List of post revisions
I need help gathering a list of post revisions. Users should be able to see this same list whether on the original post or any following revision of the post. I know that I have to somehow use the ...
0
votes
0answers
18 views
group_by association in rails iteration
I have an iteration that creates a column with items.
Preference
belongs_to :option
Option
has_many :preferences
belongs_to :category
Category
has_many :options
So, when I iterate over the ...
0
votes
1answer
15 views
before_filter in application controller for only get requests
I need to set up a before_filter in my ApplicationController that redirects a user if they have not yet agreed to a new terms of service. However, I want to restrict the filter to only run based on ...
0
votes
1answer
32 views
Rails, named scope not working
I defined an simple named scope for my patient model, as you can see here:
class Patient < ActiveRecord::Base
has_many :treatments
scope :recent_treatments, order('dateg desc')
So and in my ...
0
votes
2answers
23 views
Rails Active Record inner join not working
I have 3 models: Runners, Jobs, and Surveys. The Runner model has_many jobs. The Job model has_one Survey. I am trying to get all the Surveys for a Runner (all of the surveys that are associated with ...
0
votes
1answer
21 views
Error messages not showing
for some reason my validation error messages are not showing on the window. does it have any to do with twitter-bootstrap? I remember seeing some video tutorial, but cannot find it now unfortunately. ...
0
votes
1answer
11 views
Restricting Query Results with CanCan
I want to restrict access to report models according to roles via CanCan. Specifically, I want :admin roles to manage all, :expert roles create, read and edit all reports ascribed to their team and ...
0
votes
1answer
13 views
show validation error message from rails model
Is it possible to show validation error messages from controller by making our method ? please check the code below
validate :validation
def validation
if self.RJan.nil? && ...
1
vote
0answers
12 views
Javascript rails auto complete search drop down click event
I have a twitter typeahead auto complete search box working and my next step is to be able to click or hit enter on a result and be taken to the item's page.
Any ideas or working examples I can look ...
0
votes
1answer
15 views
current_path with haml and rails
I would like to add a css class:landing-page when a user is on the root_path. I am using haml.
%body
={:class => "landing-page" if current_page?(root_path)}
I am getting a syntax error, any ...
0
votes
0answers
19 views
Is it possible to include modules in rake task and make its methods available for the task in rails app?
In our rails 3.2.12 app, there is a rake task created under lib/tasks. The rake task needs to call a method find_config() which resides in another rails module authentify (module is not under /lib/). ...