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.
1
vote
0answers
3 views
How to integrate a blog in an existing rails app?
I have a working rails application. I would like to add a blog to it. My requirements are:
It should live on a subdirectory of my domain, eg: http://www.mydomain/blog
It should use my application ...
0
votes
0answers
11 views
Action Destroy redirect to Show Action in Rails
Well i make a buttom to delete:
<%= link_to 'delete',{ :controller => 'admin/brands',:action => 'destroy',:id => brand.id } %>
and
<%= link_to 'delete',brand,:method => ...
0
votes
0answers
7 views
Parsing RSS in a Ruby on Rails project shows the html as inline html
Im calling my feed with <%= blog_feed %> inside the view and have a little snippet in my helper.
require 'rss/1.0'
require 'rss/2.0'
require 'open-uri'
def blog_feed
source = ...
0
votes
0answers
2 views
Devise omniauth_callbacks in a localized Rails 3.2 app
I'm implementing Devise with Omniauth on a Rails 3.2 app and it works like a charm, as long as I keep using the default locale (:en).
The website set the locale through the url.
The problem I have ...
0
votes
1answer
25 views
Actions on an instance object passed to the view
I have an obj @files which sometimes contain one set of data(one file) and sometimes it contains many files.
I have a create.js.erb and this is what I do at the moment.
<% if @files.new_record? ...
0
votes
1answer
19 views
Illegal character '&' in raw string REXML parsing
Hi am trying to parse an XML file using REXML .... when there is an illegal character in my XML file ...its jus fails at this point.
So is there any way we could replace or remove these kind of ...
1
vote
2answers
25 views
Remove entry from a table without deleting it from a database
I've built a small web app in which main view shows a table and administrator has an option to remove a row by deleting it from a database using:
*.destroy
However I want to keep all the entries in ...
0
votes
0answers
16 views
Rails Creating a form where entries are saved to different rows in a table
I am trying to create a survey form in rails. The form consists of a number of questions, created by an administrator, and an "answer" text field.
I have the Survey, Question and Answer models setup, ...
2
votes
5answers
34 views
what is the difference between link_to, redirect_to, and render?
I am confused about the main difference between
link_to, redirect_to and render
in rails, anyone can please explain.
0
votes
1answer
6 views
How to give option for multiple templates for one view?
I have an application in rails3 where i want to give user an option to choose a template from defaults (4 or 5 templates) to view his records.
the approach i am working on is to sent user on setting ...
0
votes
1answer
15 views
how to use JQUERY in rails 3.2?
Hi I am a newbie in rails
need to know what things we have to be careful about
if we are willing to use jquery in rails app
in my viea page I have
<script type="text/javascript" src= ...
0
votes
1answer
27 views
Associated records count is wrong
In console I do:
board = FactoryGirl.build(:board_with_source)
board.sources
=> [#<Board id: 6, name: "Free Ruby Books", description: "Ruby Books - Free and Paid ones", created_at: "2013-06-21 ...
0
votes
0answers
33 views
update query not updating in postgresql
Not updating postgresql database when update_all using
@change_stat = Notification.where("fb_id = ? AND active = ?",@current_user.fb_id,true)
@change_stat.update_all(:active => false)
0
votes
1answer
8 views
Reading pdf in rails error “Input must be an IO-like object or a filename error on”
I'm trying to read a pdf file in rails using pdf-reader gem of rails.
Here is my code
<%
reader = PDF::Reader.new('/uploads/pdf/pdf_1.pdf')
puts reader.pdf_version
puts reader.info
puts ...
0
votes
1answer
16 views
skip carrierwave Integirty and Processing validation
I have white listed some of the extensions in the carrierwave uploader class
def extension_white_list
%w(doc docx)
end
In some cases I would like to skip the Integrity validation while saving a ...