top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to deal with css files only for specific pages for rails app?

+2 votes
378 views

I have found a html template where I some pages need specific css files and of course there are some common css files.

How can I best deal with it ?

posted Sep 18, 2014 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+2 votes

I am trying to develop an app to manage media files I have a folder with pictures, audio and video files.

I am using Dir.glob to list the directory in my controller and in my views I am using match with regular expressions to test if the file ends in mp3 jpg mp4 3gp wav etc ... the code I wrote seems to almost work The variable @file is passed on from the controller and here is my view.

Is this a sensible way of trying to do this?

<% if @file.match("mp4") %>
 <video width="320" height="240" controls>
  <source src= <%= @file %> type="video/mp4">
 </video> 
<% elsif @file.match("mp3") %>
 <audio controls preload="auto">
  <source src = <%= @file %> >
 </audio>
<% elsif @file.match("jpg") %>
 <img src= "<%= @file %>">
<% end %>
+1 vote

I was working on a test app and everything was going great. However now when I run "rails server" and none of the changes to the controller files are reflected.

If I make changes to HTML files, those are reflected. And yes, I'm sure am in the right directory editing the correct files.

I can get rid of actions in the controller files and it still works fine. Do I have to do something after I change the ruby files? I thought I could just save them then run 'rails server'... It had seemed to be working doing just that previously.

0 votes

Is it is possible to share a Rails 4 session with a Rails 4.1 application with the same secret key base on the same domain name. This works with Rails 4 to Rails 4 but it appears that my cookies are being encrypted differently between the two versions.

Any suggestions?

+1 vote

I have a project model which I'd like to set the default_scope to filter out projects where the user doesn't have permission to view them.

Think something along the lines of the projects having a list of teams and companies that the user must be in to access the data.

default_scope seems to work well if I hard code it as I really don't want a dev to accidentally not have these permissions filters in use. The lists of teams and companies a user is in is stored in the session.

0 votes

I have deployed a ruby on rails app on two instances of production server, now there are two separate log file are being created for different instances. My question is how I can make a single log file for both the instances?

...